How Capital Gains Tax Works
When you sell an asset for more than you paid for it, the profit is called a capital gain and is subject to tax. The rate you pay depends on two key factors: how long you held the asset and your taxable income. Assets held for one year or less generate short-term gains taxed at ordinary income rates (up to 37%). Assets held longer qualify for lower long-term capital gains rates (0%, 15%, or 20%).
Short-Term vs Long-Term Capital Gains Tax Rates
Short-Term Capital Gains (Held ≤ 1 Year)
Short-term gains are added to your ordinary income and taxed at the same marginal rates as your wages and salary. For 2024, these rates range from 10% to 37%. If you're in the 32% marginal bracket, your short-term gains will also be taxed at 32%.
Long-Term Capital Gains (Held > 1 Year)
Long-term gains benefit from preferential tax rates. For 2024, the long-term capital gains brackets are:
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | $0 – $47,025 | $47,026 – $518,900 | Over $518,900 |
| Married Filing Jointly | $0 – $94,050 | $94,051 – $583,750 | Over $583,750 |
| Head of Household | $0 – $63,000 | $63,001 – $551,350 | Over $551,350 |
Additional Medicare Tax / NIIT
High-income taxpayers may owe an additional Net Investment Income Tax (NIIT) of 3.8% on the lesser of their net investment income or the amount their modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This calculator includes NIIT in the total capital gains tax estimate.
Tax-Loss Harvesting Strategy
Tax-loss harvesting is a strategy where you sell investments at a loss to offset capital gains. Losses first offset gains of the same type (short-term losses offset short-term gains first), then offset gains of the other type. Up to $3,000 of net losses can be deducted against ordinary income each year, with remaining losses carried forward.
Capital Gains Tax Optimization Tips
- Hold assets longer than one year to qualify for lower long-term rates
- Tax-loss harvest by selling underperforming assets to offset gains
- Consider tax-advantaged accounts like 401(k)s and IRAs where gains can grow tax-deferred
- Time your sales to years when your income is lower (e.g., between jobs, early retirement)
- Gift appreciated assets to family members in lower tax brackets or to charity
- Use the 0% bracket if your income is below the threshold
Key Exclusions and Special Rules
- Primary residence exclusion: Up to $250,000 ($500,000 for married couples) of gain from selling your primary home may be excluded if you've lived in it for 2 of the last 5 years.
- Collectibles: Gains from collectibles (art, antiques, coins, precious metals) are taxed at a maximum 28% rate.
- Qualified Small Business Stock (QSBS): Under Section 1202, up to $10 million or 10x your basis in qualified small business stock may be excluded.
- Section 1031 exchanges: Real estate investors can defer capital gains by using like-kind exchanges for investment properties.
State Capital Gains Taxes
Most states tax capital gains as ordinary income, with rates varying from 0% (no income tax states) to over 13% (California). This calculator estimates only federal taxes. Be sure to consult a tax professional for your state-specific obligations.
Sources and References
- IRS Publication 550 — Investment Income and Expenses
- IRS Topic No. 409 — Capital Gains and Losses
- IRS Revenue Procedure 2023-34 (2024 tax brackets)
- IRS.gov — Net Investment Income Tax (NIIT) FAQs