Capital Gains Tax Calculator

Estimated federal tax on the gain$4,500.00
Capital gain$30,000
Bracket tax (before NIIT)$4,500.00
Net investment income tax (3.8%)$0.00
Effective rate on the gain15.00%
After-tax proceeds$75,500.00
How this was calculated
  1. The gain is the sale price minus your cost basis: $80,000 − $50,000 = $30,000. (In real life, selling costs and basis adjustments — reinvested dividends, improvements, depreciation recapture — move this number; this estimate keeps it simple.)
  2. Held over a year, the gain stacks on top of your other taxable income of $60,000. $0 of it fits under the $48,350 0% threshold for single filers and is taxed at 0%; $30,000 falls in the 15% band; $0 spills above $533,400 and is taxed at 20%. The bracket tax is $4,500.00.
  3. The 3.8% net investment income tax does not apply here — combined income of about $90,000 stays under the $200,000 threshold for your filing status. Total estimated federal tax: $4,500.00.
  4. This is a simplified federal estimate using 2025 thresholds: it ignores state taxes, the alternative minimum tax, collectibles and unrecaptured Section 1250 rates, wash-sale and installment rules. Confirm any large sale with a tax professional before you sell, not after.

A capital gains tax calculator estimates the federal tax owed when you sell an investment, using the gain (sale price minus cost basis) and applying the correct rate based on how long you held the asset. Long-term gains, held more than one year, follow the 2025 IRS Topic 409 brackets: 0% up to $48,350 of taxable income for single filers ($96,700 married filing jointly, $64,750 head of household), 15% in between, and 20% above $533,400 single ($600,050 joint, $566,700 head of household). Short-term gains, held one year or less, are taxed as ordinary income at your marginal rate. The 3.8% net investment income tax (NIIT) also applies to the smaller of the gain or the amount by which income exceeds $200,000 single or $250,000 joint. For example, a $15,000 long-term gain with $30,000 of other income (single) stays under the $48,350 threshold, so the federal tax is $0, while a $30,000 short-term gain at a 22% marginal rate costs $6,600.

This method is the accepted standard because it mirrors how the IRS stacks long-term gains on top of other taxable income and then applies the correct bracket rate, which is why a $30,000 long-term gain stacked on $60,000 of other income (single) falls entirely in the 15% band for $4,500 of tax, and why a $300,000 long-term gain (married filing jointly, $180,000 other income) pays $45,000 at 15% plus $8,740 of NIIT on the $230,000 above the $250,000 threshold, totaling $53,740. This page shows the formula, step-by-step workings, worked examples, and sources. Note that selling costs and basis adjustments change the real figure, and this is a simplified federal estimate that ignores state tax.

Worked examples

A $30,000 long-term gain on top of $60,000 of income (single)

The whole gain sits in the 15% band: tax $4,500, an effective 15% on the gain, no NIIT. (80000 $ · 50000 $ · 60000 $ · Single · Long-term (held over 1 year) · 22 %)

Estimated federal tax on the gain$4,500.00
Capital gain$30,000
Bracket tax (before NIIT)$4,500.00
Net investment income tax (3.8%)$0.00
Effective rate on the gain15.00%
After-tax proceeds$75,500.00

A $15,000 long-term gain with $30,000 of other income (single)

Total income stays under the $48,350 0% threshold, so the federal tax on the gain is $0. (40000 $ · 25000 $ · 30000 $ · Single · Long-term (held over 1 year) · 22 %)

Estimated federal tax on the gain$0.00
Capital gain$15,000
Bracket tax (before NIIT)$0.00
Net investment income tax (3.8%)$0.00
Effective rate on the gain0.00%
After-tax proceeds$40,000.00

A $300,000 long-term gain, married filing jointly, $180,000 other income

Bracket tax $45,000 at 15%, plus $8,740 of NIIT on the $230,000 over the $250,000 threshold — $53,740 in total. (500000 $ · 200000 $ · 180000 $ · Married filing jointly · Long-term (held over 1 year) · 24 %)

Estimated federal tax on the gain$53,740.00
Capital gain$300,000
Bracket tax (before NIIT)$45,000.00
Net investment income tax (3.8%)$8,740.00
Effective rate on the gain17.91%
After-tax proceeds$446,260.00

How long-term capital gains are taxed: the stacking rule

Long-term capital gains do not get taxed at a single flat rate based on the gain alone. Instead, the gain stacks on top of your other taxable income — wages, interest, ordinary dividends, and similar items — and the rate depends on where that combined total falls within the bracket structure. This is called the stacking rule, and it explains why two taxpayers with identical gains can owe very different amounts of federal tax. A capital gains tax calculator that ignores this layering will give you a misleading number.

For 2025, the 0% long-term rate applies up to taxable income of $48,350 for single filers, $64,750 for head of household, and $96,700 for married filing jointly. Above $533,400 single, $566,700 head of household, or $600,050 joint, the 20% rate kicks in. Between those two boundaries, the rate is 15%. The gain is sale price minus cost basis, and selling costs or basis adjustments can change the real figure. This is a simplified federal estimate that ignores state tax.

Consider a single filer with $30,000 of other taxable income and a $30,000 long-term gain. The gain stacks on top, pushing total taxable income to $90,000. Because that total clears the $48,350 threshold but stays below $533,400, the entire gain lands in the 15% band, producing tax of $4,500. Now take a single filer with $30,000 of other income and a $15,000 long-term gain. Combined taxable income is $45,000, which stays under the $48,350 threshold, so the federal tax on the gain is $0.

Higher earners also need to account for the 3.8% net investment income tax, or NIIT. This surtax applies to the smaller of the gain or the amount by which income exceeds $200,000 single or $250,000 joint. A married couple filing jointly with $180,000 of other income and a $300,000 long-term gain pays $45,000 of bracket tax at 15%, plus the 3.8% NIIT on $230,000 over the $250,000 threshold, which is $8,740 — for a total of $53,740. For comparison, short-term gains on assets held one year or less are taxed as ordinary income at your marginal rate: a $30,000 short-term gain at a 22% marginal rate costs $6,600.

Worked examples: 0%, 15% and the NIIT in action

These three verified cases show how a capital gains tax calculator translates the IRS brackets into actual dollars. Each example uses the 2025 long-term capital gains thresholds from IRS Topic 409 and assumes single filing unless noted otherwise. The gain is sale price minus cost basis; selling costs and basis adjustments change the real figure, and these are simplified federal estimates that ignore state tax.

The first two cases illustrate the difference between landing in the 0% and 15% brackets. A $15,000 long-term gain with $30,000 of other income stays under the $48,350 threshold for single filers, so the federal tax is $0. By contrast, a $30,000 long-term gain stacked on $60,000 of other taxable income falls entirely in the 15% band, producing a tax of $4,500. The full $30,000 gain is taxed at 15% because the combined $90,000 income sits above the 0% ceiling but well below the 20% threshold of $533,400.

The third case shows how the net investment income tax layers on top of the capital gains brackets. A married couple filing jointly with $180,000 of other income and a $300,000 long-term gain pays $45,000 of bracket tax at the 15% rate. The 3.8% NIIT then applies to the smaller of the gain or the amount by which income exceeds the $250,000 joint threshold. Here, modified adjusted gross income reaches $480,000, which is $230,000 over the threshold, so the NIIT equals $8,740 on that $230,000. The total federal bill comes to $53,740.

Short-term gains — those held one year or less — do not qualify for the preferential rates shown above. They are taxed as ordinary income at the taxpayer's marginal rate. A verified example: a $30,000 short-term gain at a 22% marginal rate costs $6,600, which is $2,100 more than the same gain would trigger as a long-term asset in the 15% bracket.

  • 0% rate: taxable income up to $48,350 single, $64,750 head of household, $96,700 married filing jointly
  • 15% rate: income between the 0% ceiling and $533,400 single, $566,700 head of household, $600,050 joint
  • 20% rate: income above $533,400 single, $566,700 head of household, $600,050 joint
  • NIIT: 3.8% on the smaller of the gain or excess income above $200,000 single / $250,000 joint
ScenarioOther IncomeLong-Term GainFiling StatusBracket TaxNIITTotal Federal Tax
$15,000 gain, income under 0% ceiling$30,000$15,000Single$0$0$0
$30,000 gain in 15% band$60,000$30,000Single$4,500$0$4,500
$300,000 gain with NIIT$180,000$300,000Married filing jointly$45,000$8,740$53,740
Short-term gains held one year or less are taxed as ordinary income, not at the preferential long-term rates. A $30,000 short-term gain at a 22% marginal rate costs $6,600 — $2,100 more than the same gain would cost in the 15% long-term bracket.

Short-term versus long-term: the one-year line

Short-term gains come from assets held one year or less, and the IRS taxes them as ordinary income at your marginal rate. A verified example shows how this works: a $30,000 short-term gain at a 22% marginal rate costs $6,600 in federal tax. That is the same dollar figure you would owe on $30,000 of salary, because the tax code treats the two sources of income identically. The gain itself is sale price minus cost basis, though selling costs and basis adjustments can change the real figure, and this is a simplified federal estimate that ignores state tax.

Cross the one-year line and the math shifts. For 2025, long-term capital gains thresholds under IRS Topic 409 set the 0% rate up to taxable income of $48,350 for single filers, $96,700 for married filing jointly, and $64,750 for head of household. The 20% rate applies above $533,400 single, $600,050 joint, and $566,700 head of household. Between those two boundaries, the rate is 15%. A verified calculation shows a $30,000 long-term gain stacked on $60,000 of other taxable income for a single filer falls entirely in the 15% band, producing $4,500 in tax — $2,100 less than the short-term result on the same gain.

Income level matters as much as holding period. A $15,000 long-term gain with $30,000 of other income for a single filer stays under the $48,350 threshold, so the federal tax is $0. A $300,000 long-term gain for a married couple filing jointly with $180,000 of other income pays $45,000 of bracket tax at 15%, plus the 3.8% net investment income tax on $230,000 over the $250,000 NIIT threshold, which adds $8,740 for a $53,740 total. The NIIT applies to the smaller of the gain or the amount by which income exceeds $200,000 single or $250,000 joint.

The holding-period lever is why timing a sale by weeks can change the bill by thousands. An asset sold on day 364 generates ordinary-income tax; the same asset sold on day 365 or later qualifies for long-term rates that can be 0%, 15%, or 20%. A capital gains tax calculator that accounts for both holding period and taxable income level helps estimate the difference before the trade executes, so the one-year line becomes a planning tool rather than a surprise on the return.

The 3.8% net investment income tax

The 3.8% net investment income tax (NIIT) is an additional federal surtax that can apply on top of the standard long-term capital gains rates. It kicks in when your modified adjusted gross income surpasses specific thresholds: $200,000 for single filers and $250,000 for married couples filing jointly. Because the NIIT layers on top of the 0%, 15%, or 20% capital gains brackets, it can materially change what you actually owe — and it is one of the easiest figures to overlook when you use a capital gains tax calculator for the first time.

The surtax does not apply to your entire gain. Instead, it applies to the smaller of two amounts: your net investment income for the year, or the amount by which your total income exceeds the relevant threshold. That distinction matters because it prevents the tax from sweeping up all of your investment earnings; only the portion that sits above the threshold is exposed. For someone with a large gain but income just barely over the line, the NIIT may only reach a fraction of the profit. For someone whose income already clears the threshold before the gain is counted, the NIIT can apply to the full gain.

Consider a verified example. A married couple filing jointly has $180,000 of other taxable income and realizes a $300,000 long-term gain, bringing their total to $480,000. They owe $45,000 of standard bracket tax at the 15% long-term rate. Because their total income exceeds the $250,000 joint threshold by $230,000, the NIIT applies to that $230,000 excess. Multiplying $230,000 by 3.8% produces an additional $8,740, bringing the total federal tax to $53,740. This is the number that matters when you are planning a sale, not just the headline 15% bracket rate.

The same couple would see a different result if their other income were higher. If their non-investment income already cleared the $250,000 threshold on its own, the NIIT would apply to the full $300,000 gain rather than the $230,000 excess, raising the surtax from $8,740 to $11,400. Conversely, if their total income stayed under $250,000, the NIIT would not apply at all, even though the 15% bracket tax would still be owed. The interaction between the two systems is what makes high-income sales tricky to estimate without running the numbers carefully.

Keep in mind that the NIIT is a simplified federal estimate in this context. The gain itself is sale price minus cost basis, and selling costs or basis adjustments can shift the real figure. State tax is ignored here, and many states do not mirror the federal treatment of investment income. When you run the numbers, make sure the NIIT is included as a separate line item so you can see exactly how much of your tax bill comes from the base capital gains rate and how much comes from the surtax.

  • NIIT threshold: $200,000 single, $250,000 married filing jointly
  • Applies to the smaller of net investment income or the excess of income over the threshold
  • Verified example: $230,000 excess × 3.8% = $8,740 additional tax
  • Layers on top of the 0%, 15%, or 20% long-term capital gains brackets
A $300,000 long-term gain on $180,000 of other income (married filing jointly) costs $45,000 at the 15% bracket rate plus $8,740 in NIIT, for a $53,740 total federal tax.

How to use this capital gains tax calculator

To use this capital gains tax calculator, start by entering your proceeds, which is the sale price of the asset. Next, enter your cost basis, which is what you originally paid for it. The gain is sale price minus cost basis, and selling costs and basis adjustments can change the real figure. Keep in mind that this is a simplified federal estimate that ignores state tax.

You will also need to enter your other taxable income, your filing status, and your holding period. Other taxable income matters because long-term gains are stacked on top of it when determining which bracket applies. The 2025 long-term capital gains thresholds under IRS Topic 409 set the 0% rate up to taxable income of $48,350 for single filers, $96,700 for married filing jointly, and $64,750 for head of household. The 20% rate applies above $533,400 single, $600,050 joint, and $566,700 head of household. Between those thresholds the rate is 15%.

For a verified example, a $30,000 long-term gain stacked on $60,000 of other taxable income for a single filer falls entirely in the 15% band, producing tax of $4,500. Another verified example: a $15,000 long-term gain with $30,000 of other income for a single filer stays under the $48,350 threshold, so the federal tax is $0.

Short-term gains, which apply to assets held one year or less, are taxed as ordinary income at the taxpayer's marginal rate. For this reason, the calculator asks for your marginal rate when the holding period is short-term. A verified example shows a $30,000 short-term gain at a 22% marginal rate costs $6,600.

Higher earners should also be aware of the 3.8% net investment income tax, or NIIT. It applies to the smaller of the gain or the amount by which income exceeds $200,000 single or $250,000 joint. A verified example: a $300,000 long-term gain for a married filing jointly couple with $180,000 of other income pays $45,000 of bracket tax at 15%, plus the 3.8% NIIT on $230,000 over the $250,000 NIIT threshold, which equals $8,740, for $53,740 total.

What this estimate leaves out

A capital gains tax calculator gives you a useful starting point, but the result is a simplified federal estimate. The gain itself is the sale price minus your cost basis, and selling costs plus basis adjustments can change the real figure. More importantly, the estimate does not account for several factors that can materially shift what you actually owe.

State taxes are the most obvious gap. Most states levy their own income tax on capital gains, and a few use different rates or rules than the federal government. A $300,000 long-term gain for a married couple filing jointly with $180,000 of other income pays $45,000 of federal bracket tax at the 15% rate, plus the 3.8% net investment income tax on $230,000 above the $250,000 NIIT threshold, for $53,740 total. That figure still excludes anything owed to the state.

The calculator also leaves out the alternative minimum tax, collectibles, and Section 1250 unrecaptured gain rates. Collectibles can face a higher maximum federal rate, and depreciation taken on real property may be recaptured at a special rate. Wash sale rules can disallow a loss if you buy back a substantially identical security within 30 days, and installment sales let you spread a gain across multiple years rather than recognizing it all at once.

None of those moving parts appear in a basic estimate. A $15,000 long-term gain with $30,000 of other income for a single filer stays under the $48,350 threshold, so the federal tax is $0. A $30,000 long-term gain stacked on $60,000 of other income falls entirely in the 15% band, producing $4,500 of tax. A $30,000 short-term gain at a 22% marginal rate costs $6,600 because short-term gains are taxed as ordinary income. These examples are clean, but a real return rarely is.

When a sale is large or involves unusual assets, the details matter more than the estimate. State rules, the NIIT, AMT, and basis adjustments can each change the outcome, and combining them correctly takes care. For a significant transaction, working with a qualified tax professional is the best way to move from an estimate to a reliable number.

  • State income taxes, which vary by jurisdiction and are not included in a federal estimate
  • The 3.8% net investment income tax, which applies to the smaller of the gain or the amount by which income exceeds $200,000 single or $250,000 joint
  • Alternative minimum tax, collectibles rates, and Section 1250 unrecaptured gain rules
  • Wash sale rules that can disallow losses on substantially identical securities repurchased within 30 days
  • Installment sales, which spread a gain across multiple tax years instead of recognizing it all at once
A capital gains tax calculator is a starting point, not a final answer. For large or complex sales, a tax professional can account for state taxes, the NIIT, AMT, and basis adjustments that a simple estimate cannot capture.

FAQs

What are the 2025 long-term capital gains rates?

For 2025, the long-term capital gains rates are 0% up to $48,350 of taxable income for single filers, $96,700 joint, and $64,750 head of household. The 15% rate applies up to $533,400 single and $600,050 joint. Above those thresholds, the 20% rate applies.

Can a capital gain really be taxed at 0%?

Yes. For example, a $15,000 long-term gain combined with $30,000 of other income keeps a single filer under the $48,350 threshold. Because the total taxable income stays within the 0% bracket, the federal tax on that gain is $0.

How much tax on a $30,000 long-term gain?

If you have $60,000 of other income as a single filer, the entire $30,000 long-term gain falls within the 15% capital gains bracket. The federal tax on that gain is $4,500.

What is the NIIT and when does it apply?

The 3.8% net investment income tax (NIIT) applies when your income exceeds $200,000 single or $250,000 joint. In the joint example, it adds $8,740 on $230,000 of excess income above the threshold.

How are short-term gains taxed?

Short-term gains are taxed as ordinary income at your marginal rate. For example, a $30,000 short-term gain taxed at the 22% marginal rate costs $6,600 in federal tax.

Does this calculator include state tax?

No. This calculator provides a simplified federal estimate using 2025 thresholds. Most states tax capital gains separately, so you may owe additional state taxes not reflected in this calculation.

Sources

Related calculators

Income Tax Estimate Calculator
A simplified US federal income tax estimate for 2025: standard deduction, the real progressive brackets slice by slice, your marginal and effective rates, and estimated monthly take-home.
ROI Calculator
Total and annualised return on investment (CAGR) from what you put in, what you got back, and how long it took.
Paycheck Calculator
Estimate your take-home pay per paycheck: gross pay minus pre-tax deductions, federal and state withholding, FICA and post-tax deductions.
Car Depreciation Calculator
What a car is worth after years of depreciation — a steep first-year drop followed by a steady percentage decline — with total loss and average yearly cost of ownership value.