Skip to content

Capital Gains Tax Calculator

Updated:

Estimate the capital gains tax on a stock, fund, crypto or property sale in the US. Enter purchase and sale details, holding period dates, filing status, other income and a state rate to see federal tax, the 3.8% NIIT, state tax and your after-tax profit.

Estimate Your Capital Gains Tax

Input Fields
$
What you paid for the asset, including buying fees (plus improvements if it is real estate).
$
$
Commissions, brokerage fees, closing or transfer costs — subtracted from the proceeds.
$
Your taxable income for the year from all other sources, excluding this gain and after the standard deduction. It sets which brackets the gain lands in.
%
Most states tax capital gains as ordinary income. Leave 0 to skip the state part (e.g. in FL, TX, WA and other no-income-tax states).
If enabled, the result will update automatically when you change any value.

Capital Gains Tax Formula

Formula
\[ \text{Gain} = \text{Sale price} - \text{Selling costs} - \text{Cost basis} \\ \text{Federal tax (long-term)} = 0.15 \times p_{15} + 0.20 \times p_{20} \\ \text{Federal tax (short-term)} = T(I + G) - T(I) \\ \text{NIIT} = 0.038 \times \min(G,\ \max(0,\ \text{MAGI} - \text{Threshold})) \\ \text{Total tax} = \text{Federal} + \text{NIIT} + r_{\text{state}} \times G \\ \text{After-tax profit} = G - \text{Total tax} \\ \text{Effective rate} = \frac{\text{Total tax}}{G} \times 100\% \\[ /formula] Where:
  • \(G\) — capital gain (sale price minus selling costs minus cost basis)
  • \(I\) — other taxable income for the year (after the standard deduction, excluding this gain)
  • \(p_{15}, p_{20}\) — portions of the gain falling into the 15% and 20% long-term brackets
  • \(T(\cdot)\) — ordinary income tax from the IRS bracket tables for your filing status
  • \(r_{\text{state}}\) — state capital gains tax rate (0 to skip)
The key idea is stacking: your capital gain is treated as the last dollars you earned, so it is taxed in the brackets that sit above your other taxable income.

Long-term gains are taxed at 0%, 15% or 20% depending on where your total income lands, while short-term gains are taxed at your ordinary income rates. The 3.8% net investment income tax (NIIT) may add on top if your modified AGI exceeds $200,000 ($250,000 married filing jointly).

Capital Gains Tax – Calculation Example

Example: you bought shares on May 10, 2023 for $50,000 (cost basis) and sold them on June 15, 2025 for $85,000, paying $2,500 in commissions. Your holding period is more than one year, so the gain is long-term. Filing as single in 2025, your other taxable income is $45,000 and you live in a state with no income tax.

First, the gain:

\[ G = 85{,}000 - 2{,}500 - 50{,}000 = 32{,}500 \\[ /formula]

The sale happened more than one year after purchase, so the gain qualifies for the long-term rates. For a single filer in 2025, the 0% rate applies up to $48,350 of taxable income and the 15% rate up to $533,400. Stacking the gain on top of $45,000 of other income:

\[ p_0 = 48{,}350 - 45{,}000 = 3{,}350 \quad (0\% \ \text{rate}) \\ p_{15} = 32{,}500 - 3{,}350 = 29{,}150 \quad (15\% \ \text{rate}) \\ \text{Federal tax} = 29{,}150 \times 0.15 = 4{,}372.50 \\[ /formula]

Modified AGI is \(45{,}000 + 32{,}500 = 77{,}500\), well below the $200,000 NIIT threshold, so no net investment income tax applies. The state rate is 0%.

Then the totals:

\[ \text{Total tax} = 4{,}372.50 \\ \text{Effective rate} = \frac{4{,}372.50}{32{,}500} \approx 13.45\% \\ \text{After-tax profit} = 32{,}500 - 4{,}372.50 = 28{,}127.50 \\[ /formula]

Result: a capital gain of $32,500 triggers about $4,372.50 in federal tax, an effective rate of 13.45%, leaving an after-tax profit of $28,127.50.

How to use the calculator

  1. Choose how to set the holding period: either Enter purchase and sale dates or I already know it (short- or long-term).
  2. If using dates, fill in the Purchase date and Sale date — the calculator checks the one-year rule for you. Otherwise pick Short-term (1 year or less) or Long-term (more than 1 year).
  3. Select your Filing status (Single, Married filing jointly, Head of household, or Married filing separately) and the Tax year (2025 or 2024).
  4. Enter the Purchase price (cost basis) — what you paid, including buying fees (plus improvements for real estate).
  5. Enter the Sale price (gross proceeds) and the Selling costs, such as commissions, brokerage fees, or closing costs.
  6. Enter your Other taxable income for the year, excluding this gain and after the standard deduction. This determines which brackets the gain lands in.
  7. Set a State capital gains tax rate, or leave 0 if you live in a no-income-tax state such as Florida, Texas, or Washington.

What is capital gains tax?

Capital gains tax is the tax you owe when you sell a capital asset — stocks, ETFs, mutual funds, crypto, real estate, a business — for more than it cost you. The taxable gain is not the full sale price: it is the net proceeds (sale price minus selling costs) minus your cost basis (what you paid, including purchase fees). Only this gain is taxed, so accurate record-keeping of what you paid matters as much as what you sold for.

The single most important factor is the holding period. Sell more than one year after purchase and the gain is long-term, taxed at preferential rates of 0%, 15%, or 20%. Sell within one year or less and it is short-term, taxed at your ordinary income rates — which can be nearly double. This is why investors often wait just past the one-year mark before selling appreciated assets.

Which long-term rate applies depends on your total taxable income, not just the gain. The gain is stacked on top of your other income: low earners can pay 0%, most taxpayers pay 15%, and high earners pay 20% on the portion above roughly $533,400 (single, 2025). High-income investors may also owe the 3.8% net investment income tax when their modified AGI exceeds $200,000 ($250,000 if married filing jointly).

The effective tax rate on the gain shown in the results often falls between brackets — for example, a large long-term gain may be partly at 15% and partly at 20%. The breakdown in the results explains exactly how your gain is split. If the sale produced a loss instead, no capital gains tax is due, and the loss can offset other gains plus up to $3,000 of ordinary income per year.

2025 long-term capital gains brackets (federal)

Taxable income Single Married filing jointly Head of household
0% rate up to $48,350 $96,700 $64,750
15% rate up to $533,400 $600,050 $566,700
20% rate above $533,400 $600,050 $566,700

Assumptions, limitations and practical tips

  • Capital asset only. The estimate assumes a plain capital asset and a fully taxable gain. It does not handle collectibles (28% rate), qualified small business stock exclusions, or depreciation recapture on real estate (25% rate) — all of which can change the result.
  • Holding period edge cases. The one-year clock for long-term treatment actually requires holding more than one year — sell exactly on the anniversary and the gain is still short-term. Inherited assets generally get a stepped-up basis and automatic long-term treatment.
  • Wash sales. If you sell at a loss and repurchase a substantially identical asset within 30 days, the loss is disallowed under the wash-sale rule (relevant if you use the Options Profit Calculator or trade frequently).
  • State taxes are simplified. Most states tax capital gains as ordinary income at a single rate, which is what the state field models. Some states exempt part of a gain, and a few have no income tax at all. If you itemize, state tax paid may be deductible federally.
  • Home sales. A primary residence gets a special exclusion — $250,000 of gain per person ($500,000 for joint filers) if you meet the ownership and use tests — so real estate results may be overstated. See also the Closing Costs Calculator when planning a property sale.
  • For the tax on your regular wages and salary income, use the Federal Income Tax Calculator; this tool isolates the tax on the gain itself.
  • Verify before acting. Congress adjusts brackets yearly, and large or unusual transactions (restricted stock, QSBS, carryforwards) deserve professional advice. Check Schedule D and its instructions on the IRS website for the authoritative figures.

Frequently Asked Questions

How do I calculate capital gains tax by hand without a calculator?

First compute the gain: sale price minus selling costs minus cost basis. Then add the gain on top of your other taxable income to find which brackets it fills. For long-term gains, apply 0%, 15%, or 20% to each portion of the gain depending on where your total income falls relative to the bracket thresholds. For short-term gains, subtract the tax on your ordinary income from the tax on your income plus the gain: \( T(I + G) - T(I) \). Finally, add the 3.8% NIIT if your modified AGI exceeds the threshold, plus any state tax.

What is considered a good or normal capital gains tax rate?

For a long-term gain, most US taxpayers land at an effective federal rate between 15% and 18.8% (the 15% bracket plus the 3.8% NIIT for higher earners). Low-income filers can pay 0%, while very high earners reach about 23.8% federally. Short-term gains are taxed like wages, so 22% to 37% is common. Adding state tax, a combined rate anywhere from 0% to roughly 35% is possible — long-term treatment almost always beats short-term.

Does the holding period really matter that much — how does the one-year rule work?

Yes — it can nearly halve your tax. To get long-term treatment you must hold the asset more than one year? No: the tax is based on your total taxable income, including wages, interest, and the gain itself. The gain is stacked on top of your other income. For example, if your other taxable income is $40,000 and your long-term gain is $40,000, only about $8,350 of the gain falls in the 0% bracket (up to $48,350 in 2025); the rest is taxed at 15%.

Do I need to use a state capital gains rate, and where do I find mine?

Most states tax capital gains as ordinary income, so use your state's top marginal income tax rate — for example about 13.3% in California, 10.9% in New York (before local add-ons). Nine states, including Florida, Texas, Washington (for stocks), and Nevada, have no income tax on capital gains, so enter 0. A few states offer exclusions or lower rates, so check your state's department of revenue. The state field here applies one flat rate to the entire gain, which is a reasonable approximation for most filers.

Is crypto taxed the same as stocks?

For federal purposes, yes — crypto is a capital asset, so gains are short- or long-term depending on the one-year holding rule, and the same 0%/15%/20% brackets plus the NIIT apply. The key difference is that swapping one cryptocurrency for another is itself a taxable event, unlike trading stocks inside a portfolio. Track cost basis carefully across wallets and exchanges; without records your entire sale proceeds may be treated as gain.

Can I reduce my capital gains tax legally?

Common strategies include holding past the one-year mark for long-term rates, harvesting losses to offset gains (up to $3,000 of excess loss against ordinary income per year), timing a sale into a lower-income year, donating appreciated shares to charity instead of cash, and using the $250,000/$500,000 primary home exclusion if you qualify. Avoid wash sales when selling at a loss. Tax law changes frequently, so confirm current rules or consult a professional before executing a strategy.

Leave a Reply

Your email address will not be published. Required fields are marked *