How capital gains tax works
When you sell an investment — whether capital gains tax on stocks, bonds, real estate, or crypto — for more than you paid, the profit is a capital gain. The IRS taxes this gain based on two factors: how long you held the asset and your total taxable income.
- Calculate the gain: Sale price minus purchase price (cost basis). Adjust for commissions and fees.
- Determine holding period: Less than 1 year = short-term. One year or longer = long-term.
- Apply the tax rate: Short-term gains are taxed as ordinary income (10–37%). Long-term gains get preferential rates (0%, 15%, or 20%).
- Check for NIIT: High earners may owe an additional 3.8% surtax on investment income.
Tip: Whenever possible, hold investments for at least one year to qualify for long-term rates. The difference between short-term (up to 37%) and long-term (max 20%) can save thousands on the same gain.
Short-term vs. long-term rates
Short-term (<1 year)
- Taxed as ordinary income
- Rates: 10%, 12%, 22%, 24%, 32%, 35%, 37%
- Same brackets as salary/wages
- Stacks on top of your other income
Long-term (≥1 year)
- Preferential tax rates
- Rates: 0%, 15%, or 20%
- Based on taxable income level
- +3.8% NIIT for high earners
Long-term capital gains tax rates are significantly lower than short-term capital gains tax rates. On a $50,000 gain for a single filer in the 24% bracket: short-term tax = $12,000. Long-term tax at 15% = $7,500. That's $4,500 saved by holding one extra day.
2026 long-term capital gains tax brackets
The capital gains tax rate 2026 depends on your filing status and total taxable income (including the gain):
| Rate | Single | Married Filing Jointly |
|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 |
| 20% | $533,401+ | $600,051+ |
Income thresholds are based on taxable income including the capital gain. An additional 3.8% NIIT may apply above $200K/$250K MAGI.
NIIT surtax explained
The Net Investment Income Tax (NIIT) adds 3.8% on top of your capital gains rate if your modified adjusted gross income exceeds:
Single / HoH
$200,000
Married Filing Jointly
$250,000
| Filing Status | MAGI Threshold | NIIT Rate |
|---|---|---|
| Single | $200,000 | 3.8% |
| Married Filing Jointly | $250,000 | 3.8% |
| Head of Household | $200,000 | 3.8% |
This means the maximum federal rate on long-term gains is effectively 23.8% (20% + 3.8% NIIT) for high earners.
Example calculation
A single filer with $75,000 taxable income buys stock for $5,000 and sells it 14 months later for $15,000 (long-term gain of $10,000):
- Capital gain: $15,000 − $5,000 = $10,000
- Total income with gain: $75,000 + $10,000 = $85,000 — falls in the 15% long-term bracket ($48,351–$533,400)
- Federal CG tax: 15% × $10,000 = $1,500
- NIIT: Income below $200K threshold → $0
Result: Total tax on $10,000 gain = $1,500 (15% effective rate). Net proceeds: $13,500
Capital gains tax on home sale
When you sell your primary residence, you may exclude a significant portion of the gain from capital gains tax on home sale:
Single filers
$250,000
exclusion
Married filing jointly
$500,000
exclusion
Requirements: You must have owned and lived in the home for at least 2 of the last 5 years. The exclusion can be used once every 2 years. Any gain above the exclusion amount is taxed at the applicable capital gains rate.
Strategies to minimize capital gains tax
- Hold for long-term (learn how to avoid capital gains tax legally): Wait at least one year to qualify for 0%/15%/20% rates instead of ordinary income rates (up to 37%).
- Tax-loss harvesting: Sell losing investments to offset gains. Up to $3,000 in net losses can offset ordinary income annually.
- Use the 0% bracket: If your taxable income is below $48,350 (single), long-term gains are tax-free. Time sales in lower-income years.
- Invest in tax-advantaged accounts: Gains in 401(k), IRA, and Roth accounts are tax-deferred or tax-free — no capital gains tax while inside the account.
- Donate appreciated assets: Donating stock held over a year lets you deduct the full market value while avoiding capital gains tax entirely.
- Use the home sale exclusion: The $250K/$500K primary residence exclusion is one of the largest tax breaks available.
FAQs
What is capital gains tax?
Capital gains tax is a federal (and sometimes state) tax on the profit you make when selling an asset — stocks, bonds, real estate, cryptocurrency, or other investments — for more than you paid. The tax rate depends on how long you held the asset (short-term vs. long-term) and your taxable income level.
What is the difference between short-term and long-term capital gains?
Short-term capital gains apply to assets held for less than one year and are taxed as ordinary income (10%–37% depending on your bracket). Long-term capital gains apply to assets held for one year or longer and receive preferential rates: 0%, 15%, or 20% depending on your income. Long-term rates are significantly lower for most taxpayers.
What are the 2026 long-term capital gains tax rates?
For 2026, long-term capital gains rates are: 0% for taxable income up to $48,350 (single) / $96,700 (married). 15% for income up to $533,400 (single) / $600,050 (married). 20% for income above those thresholds. An additional 3.8% NIIT surtax may apply on investment income above $200,000 (single) / $250,000 (married).
What is the home sale capital gains exclusion?
If you sell your primary residence and have lived in it for at least 2 of the last 5 years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) from capital gains tax. This is one of the most valuable tax breaks in the US tax code. The exclusion can be used once every two years.
Do I pay capital gains tax on inherited property?
Generally no — inherited assets receive a "stepped-up basis," meaning the cost basis resets to the fair market value at the date of the decedent's death. If you inherit stock worth $100,000 (originally purchased for $20,000) and sell it for $105,000, you only owe capital gains tax on the $5,000 gain from the stepped-up basis, not the original $80,000 gain.
How can I offset capital gains with losses (tax-loss harvesting)?
You can use capital losses to offset capital gains dollar-for-dollar. First, short-term losses offset short-term gains; then long-term losses offset long-term gains. Any remaining net losses can offset up to $3,000 of ordinary income per year ($1,500 if married filing separately). Unused losses carry forward to future tax years indefinitely.
Do I pay state capital gains tax?
It depends on your state. Most states tax capital gains as ordinary income at their standard state income tax rate. However, nine states — Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming — have no state income tax, meaning no state capital gains tax either. A few states like California tax capital gains at rates up to 13.3%.
What is the Net Investment Income Tax (NIIT)?
The NIIT is an additional 3.8% surtax on net investment income — including capital gains, dividends, interest, and rental income — for individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). This means high-income investors may pay up to 23.8% on long-term gains (20% + 3.8% NIIT).
Are 401(k) withdrawals considered capital gains?
No. Withdrawals from a traditional 401(k) or traditional IRA are taxed as ordinary income, not capital gains — even if the account growth came from stock market gains. This means 401(k) withdrawals don't qualify for the lower long-term capital gains rates. Roth 401(k) and Roth IRA qualified withdrawals are tax-free entirely.
How do I report capital gains on my tax return?
Report capital gains and losses on Schedule D of your federal tax return (Form 1040). Individual transactions are first listed on Form 8949. Your brokerage should provide Form 1099-B with the details of each sale. Short-term and long-term gains are calculated separately, then combined on Schedule D to determine your total capital gains tax.