Estimate federal and state capital gains tax on stocks, crypto, real estate, and other investments. Uses 2026 IRS tax brackets and handles short-term vs long-term rates, including the 3.8% Net Investment Income Tax for high earners.
Investment Details
Enter your investment details to see your federal and state capital gains tax estimate.
Capital Gain
$15,000
Total Estimated Tax
$3,825
Federal capital gains tax$2,250
Federal rate applied15%
Net Investment Income Tax (NIIT)$0
State capital gains tax$1,575
Net proceeds after tax$11,175
Effective tax rate on gain25.5%
⚠ Estimate only. Capital gains tax depends on many factors not captured here: deductions, AMT, state-specific rules (some states tax LTCG as ordinary income, others have preferential rates), depreciation recapture on real estate, wash sales, foreign accounts, and more. Consult a licensed CPA before filing or making investment decisions.
How Is Capital Gains Tax Calculated?
Quick answer: Capital gains tax = (Sale price − Cost basis) × Applicable tax rate. The applicable rate depends on how long you held the asset (≤1 year = short-term taxed as ordinary income; >1 year = long-term at 0%, 15%, or 20%), your total income, your filing status, and your state. High earners may also owe the 3.8% Net Investment Income Tax (NIIT).
The basic capital gain is straightforward: subtract what you paid (cost basis) from what you received (sale price minus selling fees). The tax complexity comes from which rate applies to that gain.
Short-Term Capital Gains (Held ≤1 Year)
Short-term gains are taxed as ordinary income — the same brackets as your salary (10%, 12%, 22%, 24%, 32%, 35%, or 37% federal in 2026). If you're in the 24% income tax bracket, your short-term gains are also taxed at 24%. This is why traders who flip stocks frequently often pay 2-3 times more tax than long-term investors.
Long-Term Capital Gains (Held >1 Year)
Long-term gains receive preferential federal rates: 0%, 15%, or 20%. For 2026 (projected, adjusted for inflation):
Filing Status
0% rate up to
15% rate up to
20% rate above
Single
$47,025
$518,900
$518,900
Married Filing Jointly
$94,050
$583,750
$583,750
Married Filing Separately
$47,025
$291,850
$291,850
Head of Household
$63,000
$551,350
$551,350
The 0% rate is one of the most valuable yet overlooked tax breaks. A retired married couple with $90,000 of other income could realize up to $4,050 of long-term capital gains with zero federal tax owed.
Net Investment Income Tax (NIIT) — Additional 3.8%
High earners pay an additional 3.8% tax on investment income (including capital gains) above:
$200,000 modified AGI for single filers
$250,000 modified AGI for married filing jointly
$125,000 modified AGI for married filing separately
This means high earners pay effectively 18.8% on long-term gains (15% + 3.8%) or 23.8% in the top bracket (20% + 3.8%).
Capital Gains on Specific Asset Types
Stocks, ETFs, and Mutual Funds
Standard capital gains rules apply. Your broker provides Form 1099-B showing your proceeds. Cost basis is tracked automatically for stocks purchased after 2011. For older holdings, you may need to calculate cost basis manually using purchase records.
Cryptocurrency
The IRS treats crypto as property, not currency. Every sale, trade, or use of crypto is a taxable event. Trading Bitcoin for Ethereum, for example, triggers capital gains on the Bitcoin. Use the compound interest growth of long-term holdings carefully — frequent trading creates significant short-term tax liability.
Real Estate (Primary Residence)
The Section 121 exclusion lets you exclude up to $250,000 in gains ($500,000 if married filing jointly) when selling your primary residence, provided you owned and lived in it for at least 2 of the previous 5 years. This is one of the largest tax breaks in the U.S. tax code. Gains above the exclusion are taxed at long-term rates.
Investment Real Estate
Investment properties don't qualify for Section 121. You also face depreciation recapture — the depreciation you claimed during ownership is taxed at up to 25% when you sell. A 1031 like-kind exchange can defer (not eliminate) capital gains tax by rolling proceeds into another investment property.
Collectibles (Art, Coins, Antiques)
Collectibles have a higher maximum federal long-term rate of 28% (not 20%). State taxes apply normally. Includes art, antiques, stamps, coins, gems, alcoholic beverages, and metals (with some exceptions for certain bullion).
Legal Strategies to Reduce Capital Gains Tax
1. Hold for More Than One Year
The single biggest reduction is the holding period. Selling a stock at day 366 instead of day 365 can drop your tax rate from 24% (short-term ordinary income) to 15% (long-term). On a $50,000 gain, that's $4,500 saved by waiting one extra day.
2. Tax-Loss Harvesting
Sell losing investments to offset gains. Losses first offset gains of the same type (short vs long), then up to $3,000 of ordinary income per year. Excess losses carry forward indefinitely. Beware the wash sale rule: you can't claim the loss if you buy the same or "substantially identical" security within 30 days before or after the sale.
3. Tax-Advantaged Accounts
Capital gains inside Roth IRAs, Traditional IRAs, 401(k)s, and HSAs are not taxed annually. In Roth accounts, qualified withdrawals are also tax-free. This is why financial planners often recommend keeping high-growth assets in retirement accounts.
4. The 0% Rate Sweet Spot
If your total income (including capital gains) keeps you in the 0% long-term bracket, you owe NO federal tax. Retirees with lower withdrawals can strategically realize gains tax-free up to the threshold each year.
5. Charitable Donations of Appreciated Assets
Donating appreciated stock directly to charity (instead of cash) eliminates the capital gains tax AND gives you the full fair-market-value deduction. A $10,000 donation of stock with $4,000 cost basis saves you ~$1,000 in capital gains tax while still providing the full $10,000 charitable deduction.
6. 1031 Exchange (Real Estate Only)
Defer capital gains tax on investment real estate by reinvesting proceeds in "like-kind" property within strict timelines (45 days to identify, 180 days to close). The tax is deferred, not eliminated — you'll owe it when you eventually sell the replacement property without another exchange.
7. Opportunity Zone Investments
Invest realized capital gains in Qualified Opportunity Zones to defer (and partially reduce) the tax. Hold for 10+ years and gains on the new investment are entirely tax-free.
State-by-State Capital Gains Tax
States vary widely in how they tax capital gains. Most states tax them as ordinary income, but some have preferential rates or no tax at all:
No State Capital Gains Tax (9 states)
Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington (except 7% on gains over $250K), and Wyoming. These states either have no income tax or specifically exempt investment income.
Highest State Capital Gains Tax Rates
California: 13.3% (highest in nation)
New York: 10.9%
New Jersey: 10.75%
Oregon: 9.9%
Minnesota: 9.85%
Washington DC: 10.75%
Combined federal + state tax in California can reach 37.1% (20% federal LTCG + 3.8% NIIT + 13.3% state). New York hits 34.7%. These are among the highest investment tax rates in the developed world.
Frequently Asked Questions
What if I lost money on my investment?
Capital losses offset capital gains. If losses exceed gains, you can deduct up to $3,000 against ordinary income per year ($1,500 if married filing separately). Unused losses carry forward indefinitely to future years.
Do I owe capital gains tax if I reinvest dividends?
Yes — dividends are taxable when received, even if automatically reinvested. The reinvested amount becomes new cost basis. This often surprises long-term investors who hold dividend-paying stocks in taxable accounts.
When do I have to pay capital gains tax?
Capital gains tax is paid with your annual tax return (April 15 typically). For large gains, you may need to make quarterly estimated tax payments to avoid underpayment penalties. The IRS uses safe-harbor rules: pay at least 100% of last year's tax (110% if AGI > $150K) to avoid penalties.
Do I owe taxes if I sell at a profit but immediately reinvest?
Yes. The IRS taxes realized gains (sale of an asset), not spent gains. Selling stock A and buying stock B with the proceeds still triggers a capital gain. The exception is 1031 exchanges for real estate.
Are capital gains taxed differently from regular income?
Long-term gains are taxed at preferential rates (0%, 15%, or 20%), which are lower than ordinary income rates (10-37%). Short-term gains are taxed exactly as ordinary income. This favorable treatment of long-term capital gains has been a feature of U.S. tax law since 1921 and is a core reason for buy-and-hold investing.