What is Capital Gains Tax and How to Avoid It Legally
Capital gains tax is what you owe when you sell an asset for more than you paid for it. It applies to stocks, real estate, cryptocurrency, and other investments. Understanding how it works " — and the legal ways to minimize it " — can save you thousands of dollars every year.
What is a Capital Gain?
A capital gain occurs when you sell an asset for a profit. If you bought stock at $1,000 and sold it for $1,500, you have a $500 capital gain. If you bought a house for $200,000 and sold it for $350,000, you have a $150,000 capital gain. The IRS taxes these gains, but the rate depends on how long you held the asset.
Short-Term vs. Long-Term Capital Gains
| Type | Holding Period | Tax Rate |
|---|---|---|
| Short-term | Less than 1 year | Ordinary income tax rate (10%-37%) |
| Long-term | More than 1 year | 0%, 15%, or 20% (depending on income) |
Long-Term Capital Gains Tax Rates (2026)
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $47,025 | $47,026-$518,900 | Over $518,900 |
| Married Filing Jointly | Up to $94,050 | $94,051-$583,750 | Over $583,750 |
| Head of Household | Up to $63,000 | $63,001-$551,350 | Over $551,350 |
The key takeaway: if your taxable income is below $47,025 (single) or $94,050 (married), you pay 0% federal tax on long-term capital gains. This is one of the most valuable tax benefits available to middle-income Americans.
Legal Ways to Reduce or Avoid Capital Gains Tax
1. Hold Investments for More Than One Year
The simplest and most effective strategy: don't sell investments within one year of buying them. Short-term gains are taxed at your ordinary income rate (up to 37%). Long-term gains are taxed at 0-20%. Holding an investment for 12 months and one day instead of 11 months can cut your tax bill by more than half.
2. Use Tax-Advantaged Retirement Accounts
Investments held in 401(k), IRA, and Roth IRA accounts are not subject to capital gains taxes while they remain in the account. A Roth IRA is especially powerful: you contribute after-tax money, it grows tax-free, and you withdraw tax-free in retirement. No capital gains tax ever.
3. Harvest Tax Losses
If you have investments that have lost value, selling them creates a capital loss. Capital losses offset capital gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of excess losses against your ordinary income each year. This strategy is called tax-loss harvesting.
4. Use the Primary Residence Exclusion
When you sell your primary home, you can exclude up to $250,000 in capital gains (single) or $500,000 (married filing jointly) from taxes. You must have lived in the home for at least 2 of the last 5 years. This means a married couple can sell their home for a $500,000 profit and owe zero capital gains tax.
5. Donate Appreciated Assets
If you donate appreciated investments (stock, real estate) directly to a charity, you avoid paying capital gains tax on the appreciation and get a tax deduction for the full market value. This is a double tax benefit.
6. Invest in Opportunity Zones
The IRS designates certain low-income areas as Qualified Opportunity Zones. Investing capital gains in Opportunity Zone funds can defer and potentially reduce your capital gains tax. Consult a tax professional for the specific rules.
7. Gift Appreciated Assets to Family Members
If you gift appreciated assets to family members in lower tax brackets, they may pay 0% capital gains tax when they sell. However, there are gift tax rules and "kiddie tax" provisions to consider " — consult a tax advisor.
- Selling and immediately rebuying (wash sale rule " — 30-day waiting period)
- Moving to a no-income-tax state (federal capital gains tax still applies)
- Cryptocurrency trading in tax-advantaged accounts (limited options)
- "I didn't sell so I don't owe taxes" " — correct, but unrealized gains are not taxed until you sell
Capital Gains on Specific Assets
- Stocks and ETFs: Standard capital gains rules apply. Taxed when you sell.
- Real estate: Primary residence exclusion ($250K/$500K). Rental property gains follow standard rules with potential depreciation recapture.
- Cryptocurrency: Treated as property by the IRS. Standard capital gains rules apply. Every trade, swap, or spending event is a taxable event.
- Collectibles: Art, coins, and collectibles are taxed at a maximum 28% rate.
- Net Investment Income Tax: High earners (over $200K single / $250K married) pay an additional 3.8% NIIT on investment gains.