Calculate Capital Gains Tax

Total Tax Owed
Capital Gain
Gain Type
Federal Tax Rate
Federal Tax
NIIT (3.8%)
State Tax
After-Tax Profit
Formulas and default parameters verified against 2025 IRS/BLS data. Results are estimates for informational purposes only.
Advertisement

Capital Gains Tax Calculator

Estimate your capital gains tax on stocks, crypto, real estate, and other investments. See federal tax, state tax, NIIT, and your after-tax profit with 2025 rates.

How to Use This Calculator

  1. Enter purchase price — What you paid for the asset, including commissions and fees.
  2. Enter sale price — What you sold it for, minus selling costs.
  3. Enter holding period — How long you held the asset in years (e.g., 1.5 for 18 months).
  4. Select filing status — Single, Married Filing Jointly, or Head of Household. This determines your tax brackets.
  5. Enter annual taxable income — Your total taxable income including this capital gain.
  6. Select your state — For state-level capital gains tax estimation.
  7. Click Calculate — See your full tax breakdown: federal tax, NIIT, state tax, and after-tax profit.

What Are Capital Gains?

A capital gain is the profit you make when you sell an asset for more than you paid for it. The IRS taxes these gains differently depending on how long you held the asset before selling. Understanding the difference between short-term and long-term capital gains is one of the most important things you can do to minimize your tax bill.

Short-Term Capital Gains (Held Less Than 1 Year)

When you sell an asset you've held for less than one year, the profit is taxed at your ordinary income tax rate — the same rate as your salary or wages. These rates range from 10% to 37% depending on your taxable income and filing status. For a high earner in the 37% bracket, a $100,000 short-term gain means $37,000 in federal tax alone, before state taxes and NIIT. If you buy a stock in March and sell it in December for a profit, that is a short-term capital gain.

Long-Term Capital Gains (Held 1 Year or More)

Assets held for one year or longer qualify for preferential tax rates of 0%, 15%, or 20%, depending on your taxable income. This is one of the most significant tax advantages available to individual investors. The difference between paying 37% on a short-term gain and 15% on a long-term gain can be enormous — on a $100,000 gain, that's $22,000 in savings just by waiting a few extra months to sell. This is why financial advisors often recommend holding investments for at least one year before selling.

2025 Long-Term Capital Gains Tax Rates

The long-term capital gains tax brackets for 2025 are as follows:

Single Filers:

  • 0% — Taxable income up to $48,350
  • 15% — Taxable income from $48,351 to $533,400
  • 20% — Taxable income over $533,400

Married Filing Jointly:

  • 0% — Taxable income up to $96,700
  • 15% — Taxable income from $96,701 to $600,050
  • 20% — Taxable income over $600,050

Head of Household:

  • 0% — Taxable income up to $64,750
  • 15% — Taxable income from $64,751 to $566,700
  • 20% — Taxable income over $566,700

Note that these brackets apply to your total taxable income, not just the capital gain itself. This means a single filer with $50,000 in total income pays 15% on the portion of their gain that falls above the $48,350 threshold, while the rest is taxed at 0%.

2025 Short-Term Capital Gains Tax Rates (Ordinary Income)

Short-term gains are taxed as ordinary income using these brackets for single filers:

  • 10% — Up to $11,925
  • 12% — $11,926 to $48,475
  • 22% — $48,476 to $103,350
  • 24% — $103,351 to $197,300
  • 32% — $197,301 to $250,525
  • 35% — $250,526 to $626,350
  • 37% — Over $626,350

For married filing jointly, the brackets are roughly double these amounts. The calculator uses the appropriate brackets based on your selected filing status.

Net Investment Income Tax (NIIT)

In addition to capital gains tax, high-income taxpayers may owe the 3.8% Net Investment Income Tax (NIIT). This surtax was enacted as part of the Affordable Care Act and applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds these thresholds:

  • Single / Head of Household: MAGI over $200,000
  • Married Filing Jointly: MAGI over $250,000
  • Married Filing Separately: MAGI over $125,000

The NIIT effectively raises the top long-term capital gains rate from 20% to 23.8%, and the top short-term rate from 37% to 40.8%. For taxpayers with significant investment income, this is a substantial additional cost. For example, a single filer with $300,000 in income and a $100,000 long-term capital gain would pay the 15% federal rate ($15,000) plus NIIT on the lesser of $100,000 (investment income) or $100,000 (excess over $200,000 threshold), resulting in an additional $3,800 in NIIT.

State Capital Gains Tax

Most states tax capital gains as ordinary income at the state level, which means your state tax bill can be significant on top of federal tax. Here's how states break down:

States with no income tax (and no capital gains tax): Texas, Florida, Washington, Nevada, Wyoming, Alaska, South Dakota. New Hampshire and Tennessee tax only dividend and interest income, not capital gains from asset sales.

States with the highest capital gains tax rates: California (13.3%), New York (10.9%), New Jersey (10.75%), Hawaii (11%), Oregon (9.9%), Minnesota (9.85%). These states tax capital gains at the same rate as ordinary income, so a large gain can push you into the highest state bracket.

States with moderate rates: Illinois (4.95% flat rate), Pennsylvania (3.07% flat rate), Michigan (4.25% flat rate), Ohio (3.5% effective), North Carolina (4.5% flat rate). Some states like Colorado have a flat tax rate that applies uniformly to all income including capital gains.

For someone with a $100,000 capital gain in California, state tax alone could be $13,300 on top of federal tax. In Texas, the state tax would be $0. This is why many high-income individuals and families consider establishing residency in no-tax states before executing large sales. However, be aware that states like California and New York aggressively audit and pursue former residents who they believe haven't truly moved — you generally need to spend more than 183 days per year in your new state and demonstrate genuine residency.

How to Minimize Capital Gains Tax

  1. Hold investments for over 1 year — This is the single most impactful strategy. Converting a short-term gain taxed at up to 37% to a long-term gain taxed at 15-20% can save you 17-22 percentage points in federal tax alone.
  2. Tax-loss harvesting — Sell investments that have lost value to offset your capital gains. You can offset an unlimited amount of gains with losses. If your losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income per year, with excess losses carrying forward indefinitely.
  3. Use tax-advantaged accounts — Investments held in 401(k), traditional IRA, and Roth IRA accounts grow tax-deferred or tax-free. In a Roth IRA, qualified withdrawals are completely tax-free, including capital gains. Maxing out these accounts each year should be a priority.
  4. Donate appreciated assets to charity — Instead of selling stock and donating cash, give the stock directly to a qualified charity. You deduct the full fair market value as a charitable contribution and pay zero capital gains tax on the appreciation. This double benefit is one of the most underused tax strategies.
  5. Step-up in basis at death — When someone passes away, their heirs receive the assets at the fair market value on the date of death, effectively eliminating all unrealized capital gains that accumulated during the original owner's lifetime. A stock purchased for $10,000 that's worth $500,000 at death gets a stepped-up basis of $500,000 — the heirs can sell immediately with no capital gains tax.
  6. Qualified Small Business Stock (Section 1202) — If you hold qualified small business stock for more than 5 years, you may be able to exclude up to $10 million (or 10 times your basis, whichever is greater) in capital gains from federal tax. This is a powerful incentive for startup investors and founders.
  7. Primary residence exclusion — If you've lived in your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) in capital gains from the sale. This exclusion can be used once every two years.
  8. 1031 exchanges for investment real estate — By reinvesting proceeds from an investment property sale into a similar "like-kind" property within strict time limits, you can defer capital gains tax indefinitely. This is a cornerstone strategy for real estate investors building wealth through property exchanges.

Frequently Asked Questions

Do I have to pay capital gains tax if I don't sell?
No. Capital gains tax is only triggered when you sell an asset for a profit. Unrealized gains (paper gains while you still hold the asset) are not taxed. This is why buy-and-hold investing is inherently tax-efficient — you defer taxes indefinitely by not selling, allowing compound growth to work uninterrupted. You only owe tax in the year you actually realize the gain by selling.
How is cryptocurrency taxed?
The IRS treats cryptocurrency as property for tax purposes. Selling crypto for fiat (USD), trading one cryptocurrency for another (e.g., Bitcoin for Ethereum), and using crypto to purchase goods or services all trigger capital gains tax. Simply buying crypto with fiat or transferring between your own wallets is not taxable. Mining and staking rewards are taxed as ordinary income at fair market value when received. See our crypto tax calculator for a dedicated tool.
Can I deduct capital losses to reduce my tax bill?
Yes. Capital losses offset capital gains dollar for dollar with no limit. If your total losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income like wages and salary each year. Any remaining losses carry forward indefinitely to future tax years. This makes tax-loss harvesting a valuable year-end strategy — selling losing positions to offset gains elsewhere in your portfolio.
What is the wash sale rule and does it apply to me?
If you sell a stock or security at a loss and buy a "substantially identical" security within 30 days before or after the sale, the IRS disallows the loss deduction. The disallowed loss is added to the cost basis of the new purchase instead. This rule applies to stocks, bonds, ETFs, and options, but as of 2025 it does NOT apply to cryptocurrency. You can sell Bitcoin at a loss and immediately repurchase it without triggering the wash sale rule, though the IRS has proposed extending this rule to crypto.
Does reinvesting dividends avoid capital gains tax?
No. Dividends are taxable in the year they are received, whether you reinvest them through a DRIP (Dividend Reinvestment Plan) or take them as cash. However, reinvested dividends increase your cost basis in the position, which reduces your capital gain when you eventually sell. It is critical to track reinvested dividends in your cost basis records to avoid paying tax on the same money twice.
What is the capital gains tax on selling my home?
If the property was your primary residence and you lived in it for at least 2 of the last 5 years, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) in gains from capital gains tax. Gains above these thresholds are taxed at the applicable long-term or short-term rates. For investment or rental properties, the full gain is taxable and you may also owe depreciation recapture tax at 25% on the depreciation you previously deducted. A 1031 exchange can defer the entire tax if you reinvest in another investment property.