How to Avoid Capital Gains Tax: 6 Legal Strategies
Learning how to avoid capital gains tax starts with an honest reset: “avoid” really means legally reduce or minimize — and the tax code gives you several legitimate ways to do it.
Key takeaways
- Hold more than one year for the long-term rate: in 2026, 0% to $49,450 (single), 15% for most investors, 20% at the top.
- Selling your main home? Exclude up to $250,000 of gain ($500,000 married filing jointly) with 24 months of ownership and use in the last 5 years.
- Keep growth inside 401(k)s and IRAs — tax-deferred while it stays in, and qualified Roth withdrawals are tax-free.
- Harvest losses to cancel gains dollar-for-dollar, plus up to $3,000 a year against ordinary income — mind the 30-day wash-sale rule.
- Donate stock held over a year instead of selling: no capital gains tax, plus a deduction for the full market value.
- At death, heirs get a step-up in basis — unrealized gains on inherited assets are effectively wiped out.
Start with the honest version: nobody legally “avoids” capital gains tax with a trick. You reduce or defer it using rules Congress wrote on purpose. One flag: this is general information, not tax advice, so run your plan past a tax professional. (See our disclaimer.)
The tax only hits when you sell an asset for more than you paid — stocks, funds, crypto, real estate, a business. Not every windfall counts: lawsuit settlements follow their own rules. For the investments and property most people sell, six legal levers do the heavy lifting.
Hold past the one-year line for long-term rates
The biggest lever is time. Sell within a year and the profit is short-term, taxed like ordinary income up to 37%. Hold more than a year and it is long-term: 0%, 15%, or 20% (Tax Foundation, from IRS Rev. Proc. 2025-32).
| 2026 long-term rate | Single filers | Married filing jointly |
|---|---|---|
| 0% | $0–$49,450 | $0–$98,900 |
| 15% | $49,451–$545,500 | $98,901–$613,700 |
| 20% | Over $545,500 | Over $613,700 |
The 0% bracket is the quiet hero: for 2026 it covers taxable income up to $49,450 single or $98,900 joint. A single filer with $40,000 of taxable income including a $10,000 long-term gain owes $0 federal tax on it. Some retirees realize gains in low-income years and immediately rebuy to reset the cost basis higher.
Selling your home? Claim the $250,000/$500,000 exclusion
Your biggest lifetime gain is probably your house — and the code’s biggest exclusion covers it. If it was your main residence, exclude up to $250,000 of gain ($500,000 married filing jointly) entirely (IRS Topic 701).
Pass two tests: own and live in the home at least 24 months of the 5 years before the sale, and no exclusion on another home in the prior 2 years. The math: buy at $280,000, sell at $680,000 — a $400,000 gain. A single filer excludes $250,000, leaving $150,000 taxable: $22,500 at 15%. And home improvements raise your adjusted basis, shrinking the gain first.
Shelter growth inside retirement accounts
The simplest way to owe zero capital gains tax is to earn gains where the tax does not apply. Inside a 401(k) or traditional IRA, investments grow tax-deferred — tax only on withdrawal. In a Roth IRA or Roth 401(k), qualified withdrawals are tax-free (IRS). Keep your highest-growth assets in retirement accounts; see our investment strategies guide.
Harvest losses before year-end
Down years hand you a tax asset. Tax-loss harvesting: sell losers to realize losses that cancel winners. With $12,000 of gains and an $8,000 loss, your net gain is $4,000 — at 15% you owe $600 instead of $1,800, a $1,200 saving, if you reinvest in a similar (not identical) asset.
Two guardrails: the wash-sale rule disallows the loss if you buy the same or a “substantially identical” security within 30 days before or after (Schwab). And losses first offset gains; beyond that, deduct up to $3,000 a year against ordinary income and carry the rest forward (IRS Topic 409).
Donate appreciated assets instead of cash
If you give to charity, never sell winners to fund it. Donate shares held over a year directly: no capital gains tax on the appreciation, plus a deduction for the full fair market value (Fidelity). A donor-advised fund lets you deduct now and give later.
The end-of-life version is the step-up in basis: heirs inherit assets at market value on the date of death, so decades of unrealized gains are never taxed (Ameriprise). For assets you never plan to sell, holding for heirs can beat selling — decide with an estate planner.
Two “strategies” that do not work
First, moving to a no-income-tax state does not dodge the federal bill — capital gains tax is federal and follows you. It may trim state tax, but the state where the asset sits can still tax the sale. Our SALT deductions guide explains the two layers. Second, “hold forever” defers tax but locks up your money — deferral is a tool, not a plan.
None of these need exotic structures — they are the ordinary levers the code offers everyone. Stack them: hold long, shelter in retirement accounts, harvest losses, give smart.
Sources & further reading
All 2026 figures checked 21 Oct 2026; worked examples are our own arithmetic, shown in full above.
- Tax Foundation — 2026 Tax Brackets2026 LTCG brackets, per IRS Rev. Proc. 2025-32 (curl: 200, 21 Oct 2026).
- IRS — Topic 701, Sale of Your Home$250k/$500k exclusion and ownership/use tests (curl: 200, 21 Oct 2026).
- IRS — Topic 409, Capital Gains and LossesLoss offsetting order; $3,000 yearly limit and carryforward (curl: 200, 21 Oct 2026).
- IRS — Individual Retirement AccountsIRA tax deferral; qualified Roth distributions tax-free (curl: 200, 21 Oct 2026).
- Charles Schwab — Wash-Sale Rule PrimerWash-sale 30-day window; substantially identical securities (curl: 200, 21 Oct 2026).
- Fidelity — Charitable Giving and TaxesDonating appreciated securities: no gains tax, deduct FMV (curl: 200, 21 Oct 2026).
- Ameriprise — How to Manage an InheritanceStep-up in basis for inherited assets (curl: 200, 21 Oct 2026).