Capital Gains Tax: How It Works, Rates & Strategies to Minimize It
How Capital Gains Are Calculated
The math is straightforward: selling price minus cost basis equals capital gain (or loss). Your cost basis is what you originally paid for the asset, plus certain adjustments like reinvested dividends, commissions, and improvements (for real estate).
If you sell for less than your basis, you have a capital loss. Losses can offset gains dollar-for-dollar, and up to $3,000 of excess losses can offset ordinary income each year. Unused losses carry forward indefinitely — a key part of tax-loss harvesting strategies.
2025 Capital Gains Tax Rates
Long-Term Capital Gains (Held > 1 Year)
| Tax Rate | Single Filer | Married Filing Jointly |
|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 |
| 20% | Over $533,400 | Over $600,050 |
Short-Term Capital Gains (Held ≤ 1 Year)
Short-term gains are taxed at your ordinary income tax rate — the same brackets that apply to your salary. For high earners, that means rates up to 37%. This is why short-term capital gains are so much more expensive than long-term gains.
When Capital Gains Tax Applies
Capital gains tax is triggered only when you realize a gain — meaning you actually sell the asset. Unrealized gains (paper profits on assets you still hold) aren’t taxed. This is why buy-and-hold investing is inherently tax-efficient: you control when the taxable event occurs.
| Taxable Event | Not a Taxable Event |
|---|---|
| Selling stock at a profit | Stock price going up (unrealized) |
| Selling real estate above basis | Transferring assets between your own accounts |
| Mutual fund capital gain distributions | Gifting appreciated stock (recipient takes your basis) |
| Exchanging crypto for another crypto | Donating appreciated stock to charity |
| Selling collectibles, art, or precious metals | Inheriting assets (basis steps up to fair market value at death) |
Special Capital Gains Situations
Primary Residence Exclusion
If you sell your primary home, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) from capital gains tax — provided you owned and lived in the home for at least 2 of the past 5 years. This is one of the most valuable tax breaks in the code.
Collectibles
Long-term gains on collectibles (art, coins, precious metals, wine) are taxed at a maximum 28% rate — higher than the standard 20% top rate for other assets.
Inherited Assets — Step-Up in Basis
When you inherit an asset, your cost basis “steps up” to the fair market value at the date of death. If your parent bought stock at $10 and it’s worth $100 when they pass, your basis is $100. You can sell immediately with little or no capital gains tax.
Strategies to Minimize Capital Gains Tax
| Strategy | How It Works |
|---|---|
| Hold longer than 1 year | Shifts gains from ordinary income rates (up to 37%) to long-term rates (0/15/20%) |
| Tax-loss harvesting | Sell losing positions to offset realized gains, reducing net taxable gain |
| Use tax-advantaged accounts | Gains inside a 401(k), Roth IRA, or HSA aren’t taxed annually |
| Harvest the 0% bracket | If taxable income is below $48,350 (single), realize gains tax-free to reset your cost basis |
| Donate appreciated stock | Avoid capital gains entirely and get a charitable deduction for the full market value |
| Specific lot identification | Choose which shares to sell (highest basis first) to minimize the taxable gain |
| Opportunity Zone investing | Defer and partially reduce capital gains by investing in qualified Opportunity Zone funds |
For a step-by-step guide, see our Capital Gains Tax Guide in the Personal Finance section.
Capital Gains in Tax-Advantaged Accounts
Gains realized inside a 401(k), Traditional IRA, Roth IRA, or HSA are not subject to capital gains tax. In a Roth IRA and HSA, they’re never taxed. In a Traditional IRA or 401(k), withdrawals are taxed as ordinary income regardless of whether the gains inside were short-term or long-term — the distinction doesn’t matter inside tax-deferred accounts.
This is why your asset allocation across account types matters. Assets you trade frequently belong in tax-advantaged accounts. Long-term buy-and-hold positions with low turnover are more tax-efficient in taxable accounts.
Key Takeaways
- Capital gains tax applies when you sell an asset for more than your cost basis.
- Long-term gains (held > 1 year) are taxed at 0%, 15%, or 20% depending on income. Short-term gains are taxed as ordinary income.
- The 3.8% NIIT surtax can push effective rates to 23.8% (long-term) or 40.8% (short-term) for high earners.
- Tax-loss harvesting, holding periods, and tax-advantaged accounts are the primary tools for minimizing capital gains tax.
- Inherited assets receive a step-up in basis — one of the most powerful tax provisions for wealth transfer.
Frequently Asked Questions
Do I pay capital gains tax on stocks I haven’t sold?
No. Capital gains tax is only triggered when you sell (realize the gain). Unrealized gains — stocks sitting in your portfolio that have gone up — are not taxed until you sell. Mutual funds can distribute capital gains even if you haven’t sold shares, though.
What’s the difference between short-term and long-term capital gains?
Short-term gains (held ≤ 1 year) are taxed at ordinary income rates up to 37%. Long-term gains (held > 1 year) get preferential rates of 0%, 15%, or 20%. Holding an extra day can mean the difference between a 37% and a 15% tax rate.
How do capital losses reduce my taxes?
Capital losses first offset capital gains dollar-for-dollar. If losses exceed gains, you can deduct up to $3,000 of net losses against ordinary income per year. Any remaining losses carry forward to future years indefinitely.
Do I owe capital gains tax when I sell my house?
Not on the first $250,000 of gain ($500,000 for married couples) if you’ve owned and used the home as your primary residence for at least 2 of the past 5 years. Gains above the exclusion are taxed at long-term capital gains rates.