Reduce, defer or eliminate: the three outcomes
Every legitimate strategy for stock gains does one of three things. It reduces the tax (a lower rate or a smaller gain), defers it (the gain is still there, just later), or eliminates it (the gain is never taxed to anyone). Knowing which one you are getting is the difference between planning and a surprise bill later.
This page is the menu for an ordinary stock portfolio: index funds, individual stocks, RSU shares you kept. Each strategy gets a short summary and a link to the page that covers it in full. If one holding makes up most of your net worth, start with our concentrated stock position guide instead.
This is tax education, not individualized tax advice. Taxstra does not sell investments or recommend securities.
Selling inside the 0 percent bracket, trading inside a Roth account, giving shares to charity, holding until death and the QSBS exclusion are the main ways a gain is never taxed. Loss harvesting, exchange funds and most other tools defer the gain. Deferral is still valuable, because money not paid in tax keeps compounding, but it is not the same thing.
What does not work
If someone promises to make stock gains vanish without one of the strategies below, ask exactly which code section does the work. Real strategies have one.
- Reinvesting the proceeds. Buying other stocks or funds with the money does not defer the tax on the gain you realized. The sale is taxed in the year it happens.
- A 1031 exchange. Since 2018, section 1031 applies only to real property. Stocks, funds and other securities do not qualify.
- An installment sale of public stock. Section 453(k)(2) bars the installment method for stock traded on an established securities market, so the whole gain is taxed in the year of sale even if you are paid later.
- Selling at a loss and buying back within 30 days. The wash sale rule disallows the loss for now and adds it to the basis of the new shares.
Strategy 1: Hold more than one year
Shares held one year or less produce short-term gain, taxed at your ordinary income rates, up to 37 percent. Shares held more than one year produce long-term gain, taxed at 0, 15 or 20 percent depending on your taxable income. Waiting one more day can cut the federal rate on a gain nearly in half.
The 3.8 percent net investment income tax applies on top of either rate once modified AGI is above $250,000 for joint filers or $200,000 for single filers. Those thresholds are not indexed for inflation.
| Rate | Single | Married filing jointly | Head of household |
|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $66,200 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 | $66,201 to $579,600 |
| 20% | Over $545,500 | Over $613,700 | Over $579,600 |
Source: IRS Rev. Proc. 2025-32, sec. 4.03. Thresholds apply to total taxable income, with gains stacked on top of ordinary income.
How the brackets stack, with 2027 figures, is on our capital gains tax rates page.
Strategy 2: Sell in a year the 0 percent bracket covers the gain
Long-term gain is taxed at 0 percent federally to the extent your taxable income, including the gain, stays at or below $98,900 for joint filers in 2026 ($49,450 single). Years between jobs, early retirement before Social Security and required distributions start, a sabbatical or a year of large business losses can open that room.
Suppose a retired couple has $60,000 of taxable income in 2026 before any sales. They can realize up to $38,900 of long-term gain at a 0 percent federal rate. Because the wash sale rule applies only to losses, they can buy the same shares back right away and start over with a higher basis. That is often called gain harvesting.
A 0 percent gain is still income. It raises AGI, which can affect state income tax, Medicare premium surcharges, premium tax credits and the taxable share of Social Security benefits. Model those before you harvest.
Strategy 3: Harvest losses to offset gains
Selling positions that are down produces capital losses. Losses first offset capital gains without limit, then up to $3,000 of other income a year ($1,500 married filing separately), and any excess carries forward with no time limit.
The wash sale rule disallows a loss if you buy substantially identical stock or securities within 30 days before or after the sale, including in an IRA. The usual answer is to reinvest in something similar but not substantially identical. Harvesting mostly defers tax, because the replacement has a lower basis, but losses used against short-term gains or ordinary income at high rates can be a permanent saving.
See our tax loss harvesting guide, direct indexing for harvesting at the single-stock level, and how a capital loss carryover works.
Strategy 4: Choose which shares you sell
If you bought the same stock or fund at different times, each purchase is a separate lot with its own basis. Unless you identify the lots you are selling to your broker by the time of the sale, the default is first-in, first-out (mutual fund shares can also use average basis), which usually means selling the oldest, lowest-basis shares and realizing the most gain.
Specific identification lets you sell the highest-basis lots first, or long-term lots at a loss before short-term lots at a gain. Most brokers let you set a default method or pick lots on each sale.
RSU shares are a common trap: the value taxed as wages at vesting is your basis, but broker forms often show a lower or zero basis. Reporting the form as is taxes the same income twice.
Strategy 5: Let growth happen inside retirement accounts
IRAs, 401(k)s and similar plans are exempt from tax, so you can rebalance and sell inside them without any capital gain tax. Traditional account withdrawals are later taxed as ordinary income; qualified Roth distributions are tax-free, which makes a Roth the one account where gains are never taxed.
Asset location means placing the holdings you expect to trade or that throw off taxable income in tax-advantaged accounts and broad, low-turnover funds in taxable accounts. It changes how much of your future gain is ever exposed to capital gain tax.
See our asset location strategy.
If you give to charity, giving shares you have held more than one year generally gets you a deduction at fair market value, and the built-in gain is never taxed to you or the charity. Gifts of appreciated stock to public charities and donor-advised funds are limited to 30 percent of AGI, with a five-year carryover. Starting in 2026, itemized charitable deductions are reduced by a floor of 0.5 percent of AGI, and taxpayers with income reaching the 37 percent bracket face a reduction in the value of their itemized deductions.
You can then use the cash you would have given to buy new shares at today’s price. Your portfolio is the same size, with a higher basis.
For larger gifts with an income stream back to you, a charitable remainder trust can sell contributed shares without tax at the trust level. You are taxed as payments come out, so the gain is spread over years rather than eliminated.
See the donor-advised fund tax deduction and our charitable remainder trust guide.
Strategy 7: Give shares to family in a lower bracket
A gift of shares carries your basis and holding period to the recipient. If an adult child or parent in the 0 or 15 percent bracket sells, the gain is taxed at their rate, not yours.
The kiddie tax blocks the easy version. Children under 18, and 18-year-olds and full-time students under 24 whose earned income does not exceed half their support, generally pay tax at the parents’ rate on unearned income above $2,700 in 2026. Gifts above the $19,000 annual exclusion per recipient in 2026 require a gift tax return, though tax is rarely owed. And once the shares are given, they belong to the recipient.
See how the kiddie tax works and the gift tax limit.
Strategy 8: Hold until death for a step-up in basis
Shares inherited from someone who dies generally take a basis equal to their fair market value at the date of death. The gain built up during the owner’s life is never taxed. For older investors with low-basis shares, not selling is often the most valuable decision on this list.
The cost is that you carry the investment risk until then. Selling from cash, bonds or high-basis lots first, and spending down retirement accounts in a planned order, keeps the lowest-basis shares available for the step-up.
Strategy 9: Special rules for startup stock and reinvested gains
Qualified small business stock: original-issue stock in a qualifying C corporation can have part or all of the gain excluded under section 1202. For stock acquired after July 4, 2025, the exclusion is 50 percent after three years, 75 percent after four and 100 percent after five, up to the greater of $15 million or 10 times basis per company. Founders and early employees should check this before selling anything.
Qualified opportunity funds: investing a capital gain in a qualified opportunity fund within 180 days defers it. Gain invested by December 31, 2026 is included in income in 2026 under the prior rules; gain invested after that is deferred five years with a 10 percent basis increase, and the fund investment’s own growth can be excluded after 10 years. It is a real estate or business investment with its own risk, not a tax product.
See QSBS under section 1202 and qualified opportunity funds.
Strategy 10: For one large position, the bigger tools
When one stock is a large share of your net worth, the options widen: selling in stages across tax years, contributing shares to an exchange fund that diversifies you without a sale (the low basis carries over), or a charitable remainder trust. These tools have minimums, fees and lockups that make them worth it only for large positions.
Compare them on our concentrated stock position guide and see how an exchange fund is taxed.
Capital gains tax strategies compared
This table compares the federal tax effect only. Investment risk, liquidity and family goals are separate questions.
| Strategy | Effect on the gain | Tends to fit |
|---|---|---|
| Hold more than one year | Reduces the rate | Anyone who can wait |
| Sell in the 0 percent bracket | Eliminates, up to the threshold | Low-income years, early retirees |
| Harvest losses | Mostly defers; can reduce | Taxable accounts with losing positions |
| Choose high-basis lots | Reduces gain now, defers the rest | Anyone who bought over time |
| Trade inside retirement accounts | Defers; eliminates in a Roth | Active rebalancers |
| Give shares to charity or a DAF | Eliminates on the shares given | People who already give |
| Give shares to family | Reduces the rate | Adult family in lower brackets |
| Hold until death | Eliminates | Older investors with low basis |
| QSBS | Eliminates part or all | Founders, early startup employees |
| Opportunity fund | Defers; can exclude later growth | Large gains with a long horizon |
| Exchange fund | Defers | One large, low-basis public stock |
Educational summary of federal treatment. Each strategy depends on facts covered on its own page.
Worked example: the same sale, planned and unplanned
Suppose a married couple filing jointly needs $160,000 for a home purchase. They plan to sell $200,000 of an index fund bought years ago for $50,000, all long-term, and they also planned to give $40,000 in cash to charity this year. Their taxable income before the sale is $250,000 and their modified AGI is already above the $250,000 net investment income tax threshold, so the gain lands in the 15 percent bracket plus 3.8 percent.
In the planned version they harvest a $30,000 loss in another fund (reinvesting in a fund that is not substantially identical), give $40,000 of the low-basis fund shares to their donor-advised fund instead of cash, and sell $160,000 of the remaining shares, which carry $40,000 of basis. They end with the same $160,000 of cash and the same $40,000 charitable gift.
Worked example
Selling $200,000 of shares with a $50,000 basis
- Unplanned: long-term gain
- $150,000
- Unplanned: federal tax at 15% plus 3.8%
- $28,200
- Planned: gain on the $160,000 sold
- $120,000
- Less harvested loss
- ($30,000)
- Planned: net gain taxed
- $90,000
- Planned: federal tax at 15% plus 3.8%
- $16,920
- Federal tax this year, difference
- $11,280 lower
- Gain on the donated shares, never taxed
- $30,000
Hypothetical round numbers. The charitable deduction is the same $40,000 either way, subject to the 2026 limits, assuming they itemize. Of the $60,000 less gain, the $30,000 on the donated shares is eliminated; the $30,000 from the harvested loss is mostly deferred, because the replacement fund has a lower basis. State tax is ignored. Educational, not individualized tax advice.
When to hire a CPA, and when you can handle it yourself
Holding past one year, setting your lot method and giving shares instead of cash are things most investors can do themselves with a broker and a calendar.
A CPA earns the fee when the strategies interact: a year-end projection that sizes gain harvesting under the 0 percent line, a large sale stacked on equity compensation and the 3.8 percent tax, a move between states, QSBS or opportunity fund elections, or a multi-year plan for a large position. Taxstra does that tax work once engaged, and coordinates with your investment adviser on what to sell.
What to check before you act
A practical review sequence for the return, books, or planning file.
Confirm the purchase date of every lot you might sell; long-term starts after one year.
Set your broker’s lot method to specific identification or a high-cost default.
Project this year’s taxable income to see how much gain fits under the 0 or 15 percent line.
List positions with unrealized losses and plan replacements that are not substantially identical.
Check the 30-day wash sale window across every account, including IRAs and a spouse’s accounts.
Use appreciated shares, not cash, for this year’s charitable gifts.
Mark the lowest-basis shares to hold for a step-up if they fit your estate plan.
Check whether any startup stock may qualify for QSBS before selling it.
“I recently had the pleasure of working with Taxstra, and I must say, the experience exceeded my expectations. From start to finish, their professionalism, expertise, and customer care were outstanding.”
Published client feedback. Individual experiences vary.
High income earner, business owner or landlord? Here is what this changes for you.
Book your free 30-minute tax fit call to talk through your next steps.
Common mistakes
The shortcuts most likely to produce a confident but wrong answer.
Thinking reinvesting defers the tax
Reinvesting does not defer anything. The sale is taxed in the year it happens, and 1031 exchanges are for real estate only.
Selling a day early
Shares held one year or less are short-term, taxed at ordinary rates up to 37 percent.
Triggering a wash sale in another account
Buying the same security within 30 days in an IRA or a spouse’s account can still disallow the loss.
Letting the broker pick lots
First-in, first-out usually sells the lowest-basis shares and realizes the most gain.
Double-counting RSU income
Using the broker’s zero or partial basis for vested RSU shares taxes the vesting income twice.
Giving cash while holding low-basis shares
A gift of appreciated shares held over a year generally gets the same deduction and also avoids the gain.
