Slug: capital-gains-tax-calculator | Title Tag: Capital Gains Tax Calculator — Federal Tax on Investment Profits (2025) | Focus Keyword: capital gains tax calculator | Schema: FAQPage

HomeTools › Capital Gains Tax Calculator

Tax Tool

Capital Gains Tax Calculator

Calculate your federal tax on investment profits — stocks, real estate, crypto, or any capital asset. See the tax difference between short-term and long-term holding periods.

💰 Your Sale
$
$
Original price + commissions + improvements
$

📋 Your Tax Situation
$
Taxable income before this sale
%
0% for TX, FL, NV, WA, etc. Up to 13.3% for CA
$
Losses from other sales this year
🏛️
Estimated Capital Gains Tax
$0
on $0 net gain — 0% effective CG rate
Total Tax on Gain
$0
federal + state + NIIT
Net Gain (After Tax)
$0
what you keep
Federal CG Rate
0%
long-term
Net Proceeds
$0
cash after all taxes
Gross Gain
$0
Net Taxable Gain
$0
Federal Tax
$0
NIIT (3.8%)
$0
State Tax
$0
Long-Term (>1 year)
Federal Rate
Federal Tax
NIIT
State Tax
Total Tax
Net After Tax
Short-Term (≤1 year)
Federal Rate
Federal Tax
NIIT
State Tax
Total Tax
Net After Tax
Tax Savings by Holding Long-Term
From Sale Proceeds to Cash in Pocket
How Your Gain Is Split
Gain AmountFederal Tax (LT)Federal Tax (ST)LT SavingsNet After Tax (LT)
Long-Term Capital Gains Rate by Income Level
0% Rate Zone
15% Rate Zone
20% Rate Zone

How to Use This Capital Gains Tax Calculator

Enter the sale price (what you received) and your cost basis (what you originally paid, including commissions and any improvements for real estate). The difference is your gross capital gain. If you have selling expenses (broker fees, closing costs), enter those — they reduce your taxable gain.

Select your holding period: long-term (held over one year) for preferential 0/15/20% rates, or short-term (one year or less) where gains are taxed as ordinary income at your marginal bracket. Enter your ordinary income because capital gains rates depend on your total taxable income — the gain “stacks on top” of your salary when determining which bracket applies.

If you have capital losses from other sales this year, enter them — they offset gains dollar for dollar. The Short vs Long tab shows exactly how much you’d save by holding past the one-year mark. For a complete income tax picture, see the tax bracket calculator.

2025 Long-Term Capital Gains Rates

Capital Gain
Net Gain = Sale Price − Cost Basis − Selling Expenses − Capital Losses

Tax on Gain
Federal CG Tax + NIIT (if applicable) + State Tax
RateSingle (Taxable Income)Married Filing JointlyHead of Household
0%Up to $48,350Up to $96,700Up to $64,750
15%$48,351 – $533,400$96,701 – $600,050$64,751 – $566,700
20%Over $533,400Over $600,050Over $566,700

These rates apply only to long-term gains — assets held for more than one year. Short-term gains are taxed at your ordinary income rate (10–37%). The total taxable income includes both your ordinary income and the capital gain for bracket-determination purposes.

Short-Term vs Long-Term: The Holding Period Matters

The difference between selling at 364 days and 366 days can be thousands of dollars in taxes. Short-term gains are taxed as ordinary income — at rates up to 37%. Long-term gains get preferential treatment at 0%, 15%, or 20%. For most investors in the middle brackets, this means paying 15% instead of 22–24% — a significant savings on large gains.

Scenario ($20K gain, single, $85K salary)Short-Term TaxLong-Term TaxSavings
Federal capital gains tax$4,400 (22%)$3,000 (15%)$1,400
+ NIIT (if above $200K MAGI)$0$0$0
Total federal tax on gain$4,400$3,000$1,400
💡 The 0% Capital Gains Bracket Is Real

If your total taxable income (ordinary + gains) stays below $48,350 (single) or $96,700 (MFJ), your long-term capital gains are taxed at 0% federally. This is especially powerful for retirees with low ordinary income, or anyone in a year with reduced earnings. You can strategically realize gains in these years to reset your cost basis tax-free — a technique called tax-gain harvesting.

Net Investment Income Tax (NIIT)

High earners face an additional 3.8% surtax on net investment income — including capital gains, dividends, interest, and rental income. The NIIT kicks in when your Modified Adjusted Gross Income (MAGI) exceeds $200,000 (single) or $250,000 (MFJ). It applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.

Filing StatusNIIT ThresholdMaximum Combined LT Rate
Single$200,00023.8% (20% + 3.8%)
Married Filing Jointly$250,00023.8%
Married Filing Separately$125,00023.8%
Head of Household$200,00023.8%

Tax-Loss Harvesting: Offset Gains With Losses

Capital losses offset capital gains dollar-for-dollar. If you have $20,000 in gains and $8,000 in losses from other investments, you only pay tax on $12,000 of net gains. If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income each year, and carry forward the rest indefinitely.

This is a core tax optimization strategy called tax-loss harvesting. The key rule: the wash-sale rule prohibits you from claiming a loss if you buy a “substantially identical” security within 30 days before or after the sale. You can buy a similar (but not identical) ETF as a replacement to maintain market exposure while still capturing the tax benefit.

⚠ State Taxes Add Up

This calculator includes an optional state tax estimate. California taxes capital gains as ordinary income (up to 13.3%). New York City residents can face a combined state+city rate over 12%. Meanwhile, states like Texas, Florida, Nevada, and Washington have no income tax at all. Where you live matters — a lot. If you’re planning a large sale, understanding your total state+federal rate is critical.

Related Tools

CalculatorUse It For
Tax Bracket CalculatorFull federal income tax computation by bracket
ROI CalculatorCompute after-tax return on investment
Compound Interest CalculatorProject growth in tax-sheltered accounts
DRIP CalculatorModel dividend tax drag vs tax-deferred reinvestment
Retirement CalculatorPlan tax-deferred growth in 401(k) / IRA
Inflation CalculatorAdjust gains for purchasing power

FAQ

How are capital gains taxed in the US?

Capital gains are taxed based on how long you held the asset. Long-term gains (held over one year) get preferential rates: 0%, 15%, or 20% depending on your total taxable income. Short-term gains (one year or less) are taxed as ordinary income at your marginal tax bracket — up to 37%. The specific rate depends on your filing status and total income, including the gain itself.

What is cost basis and how do I calculate it?

Cost basis is the original price you paid for the asset, plus any costs directly related to the purchase (commissions, transfer fees). For stocks, it’s your purchase price per share times the number of shares, plus any buying commissions. For real estate, it includes the purchase price plus closing costs plus capital improvements (but not routine maintenance). A higher cost basis means a lower taxable gain.

What is the 0% capital gains bracket?

If your total taxable income (including the gain) stays under $48,350 for single filers or $96,700 for married filing jointly in 2025, your long-term capital gains are taxed at 0% federally. This is a real, usable tax bracket — not a loophole. Retirees, students, or anyone with a low-income year can strategically realize gains in this bracket with zero federal tax.

What is the Net Investment Income Tax (NIIT)?

The NIIT is a 3.8% surtax on net investment income (capital gains, dividends, interest, rental income) that applies when your MAGI exceeds $200,000 (single) or $250,000 (married filing jointly). It’s in addition to the regular capital gains tax. At the top end, long-term gains can face a combined federal rate of 23.8% (20% + 3.8% NIIT).

Can capital losses offset gains?

Yes. Capital losses offset capital gains dollar-for-dollar. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains, then any remaining losses cross over. If total losses exceed total gains, you can deduct up to $3,000 of net losses against ordinary income per year, with unlimited carryforward of the excess.

What is the wash-sale rule?

If you sell a security at a loss and repurchase the same or “substantially identical” security within 30 days before or after the sale, the IRS disallows the loss deduction. This prevents investors from booking losses for tax purposes while maintaining the same position. The workaround: buy a similar but not identical fund (e.g., swap one S&P 500 ETF for another total-market ETF).

Are cryptocurrency gains taxed like stocks?

Yes. The IRS treats cryptocurrency as property, not currency. Selling, trading, or spending crypto triggers a capital gains event. The same short-term / long-term holding period rules apply: hold over a year for the lower long-term rates. Every crypto-to-crypto trade, crypto-to-fiat sale, and purchase made with crypto is a taxable event.

How does selling a home affect capital gains?

You can exclude up to $250,000 of gain ($500,000 if married filing jointly) on the sale of your primary residence if you’ve lived in it for at least 2 of the last 5 years. Gains above the exclusion are taxed at capital gains rates. This is one of the most valuable tax benefits in the US tax code — and it’s why many homeowners pay zero capital gains tax on their home sale.

Key Takeaways

  • Long-term beats short-term — holding over one year drops your rate from up to 37% to 0/15/20%. On a $50K gain, that can save $5,000–$8,000+ in federal tax alone.
  • The 0% bracket is powerful — single filers with total taxable income under $48,350 pay zero federal capital gains tax. Retirees and low-income years can use this strategically.
  • NIIT adds 3.8% for high earners — once MAGI exceeds $200K (single) or $250K (MFJ), net investment income gets an extra surtax, pushing the max combined rate to 23.8%.
  • Losses offset gains — use tax-loss harvesting to reduce your bill. Up to $3,000 of excess losses deduct against ordinary income, with unlimited carryforward.
  • State tax varies wildly — from 0% (TX, FL, NV) to 13.3% (CA). Your state can add significantly to the total capital gains tax burden.
  • Cost basis matters — the higher your documented basis, the lower your taxable gain. Track purchase prices, commissions, and improvements carefully.