Capital Gains Tax Calculator: Tax Owed on an Investment Gain

Work out the tax owed on a realized capital gain, and see how much of the gain is left once the tax is paid.

Percentage & Amount
The all-in rate — federal long-term rate, plus any surcharges and state tax that apply to you.
$
Sale proceeds minus cost basis. Enter the net gain, not the sale price.
Your estimate

Adjust the inputs and select Calculate for a full breakdown.

Compare Common Scenarios

How the numbers shift across typical situations for this calculator:

ScenarioCapital gains taxAfter-tax gain
20% on $50,00010,00040,000
15% on $10,0001,5008,500
23.8% on $250,00059,500190,500
32% on $8,0002,5605,440

How This Calculator Works

Enter the realized gain — sale proceeds less cost basis — and the all-in tax rate that applies to you. The calculator multiplies the two to give the tax owed and shows the after-tax gain.

The Formula

Percentage of an Amount

Result = Amount × Percentage / 100

Amount is the base value, Percentage is the rate applied to it

Worked Example

A $50,000 long-term gain taxed at 20% owes $10,000 in capital gains tax, leaving $40,000 after tax. The rate that applies depends on holding period, income bracket, and surcharges — be sure the rate you use matches your real-world situation.

Key Insight

Short-term gains — assets held a year or less in the US — are usually taxed as ordinary income, which can mean 35% or more for high earners. Holding past the one-year mark often more than halves the tax. The rate is the lever; the timing decision can be worth more than the trade.

Long-term vs short-term: the 1-year cliff that doubles your tax

Capital gains are split into two regimes based on holding period. SHORT-TERM (held ≤ 1 year): taxed as ORDINARY INCOME at marginal rate — 10%, 12%, 22%, 24%, 32%, 35%, or 37%. LONG-TERM (held > 1 year and 1 day): taxed at preferential rates — 0%, 15%, or 20% based on total income.

Concrete example: $50,000 gain in single filer at $200k taxable income. Short-term: $50k × 32% marginal = $16,000 tax. Long-term: $50k × 15% (in 15% LTCG bracket) = $7,500. The 1-year holding period saves $8,500 on this single trade.

Tax-day timing tactic: if you bought stock Feb 15, 2025 at $100 and it's worth $150 today (Feb 10, 2026), selling would be SHORT-term (under 365 days). Waiting just 6 more days (until Feb 16, 2026) crosses the 1-year mark. Same $50k gain, but at preferential rate. For high earners, that 6-day wait can be worth thousands. The IRS measures 'holding period' starting the day AFTER purchase.

2025 long-term capital gains brackets and the 0% rate

Long-term capital gains brackets for 2025 (single filers): 0% on income up to $48,350. 15% on income $48,350-$533,400. 20% on income above $533,400. Married filing jointly: 0% to $96,700; 15% to $600,050; 20% above. These brackets are INCOME-based, not gain-based — the rate depends on your total taxable income for the year (including the gains themselves).

The 0% bracket is a legitimate tax planning opportunity. Strategic example: a single retiree with $30,000 of regular income (Social Security + small pension) has $18,350 of room in the 0% bracket ($48,350 − $30,000). They can sell appreciated stock with up to $18,350 of long-term gain TAX-FREE. Many retirees in early years (before RMDs kick in at 73) deliberately realize gains to use the 0% bracket annually.

Higher-earner 20% bracket: requires income above $533,400 single / $600,050 joint. Combined with NIIT (Net Investment Income Tax) of 3.8% above $200k single / $250k joint, top marginal long-term rate is 23.8% federal. Still cheaper than the top ordinary income rate of 37% — preferential treatment preserved even at high incomes.

Tax-loss harvesting: turning losses into tax savings

When you sell at a loss, the LOSS offsets capital GAINS first (long-term losses against long-term gains, short-term against short-term, then cross-application). Excess losses up to $3,000/year can offset ORDINARY INCOME. Beyond $3,000, the loss CARRIES FORWARD indefinitely to future years.

Strategic harvesting: at year-end, review portfolio for positions with losses. Sell them (realizing the loss), but immediately buy a similar (but NOT 'substantially identical' per wash sale rule) position. Example: sell Vanguard S&P 500 fund at a loss, buy Vanguard Total Stock Market — different fund but similar exposure. Loss realized for tax purposes; portfolio remains invested.

Wash sale trap: cannot buy 'substantially identical' security within 30 days BEFORE or AFTER the loss sale. Violation: loss is DISALLOWED for tax purposes — added to cost basis of replacement security instead. Common mistakes: selling individual stock loss, buying it back within 30 days. Selling ETF, buying same ETF in IRA (wash sale across accounts!). Selling stock for spouse to buy back. Manage wash sale rules carefully — many tax software programs flag potential violations.

2025 long-term capital gains tax brackets

Tax rate on long-term capital gains by total taxable income (gains included). Plus 3.8% NIIT above the surtax threshold ($200k/$250k).

Taxable incomeSingle filerMarried filing jointlyPlus NIIT 3.8%?
Up to $48,350 (single) / $96,700 (joint)0%0%No
$48,351 - $200,000 single / $250,000 joint15%15%No
Above NIIT threshold to LTCG 20% threshold15% + 3.8% NIIT = 18.8%15% + 3.8% = 18.8%Yes
$533,401 - end (single) / $600,051 - end (joint)20% + 3.8% = 23.8%20% + 3.8% = 23.8%Yes

Short-term gains (held ≤ 1 year) are taxed at ordinary income rates (10% to 37%) instead. State tax adds 0-13% depending on state. NIIT applies to all net investment income (gains, dividends, interest) above thresholds.

Frequently Asked Questions

How is capital gains tax calculated?

Multiply the realized gain by the applicable tax rate. A 20% rate on a $50,000 long-term gain is $10,000 of tax. Short-term and long-term gains often use different rates.

What is the difference between short-term and long-term?

In the US, gains on assets held more than one year are long-term and taxed at preferential rates. Shorter holding periods are taxed as ordinary income, which is usually higher.

What rate should I use?

Long-term US federal rates are typically 0%, 15%, or 20% by income. Add the net investment income tax surcharge for high earners, plus any state tax that applies.

Are losses handled here?

No. Net losses against gains for the year before entering the figure. The calculator works on the net realized gain, not gross gains.

Does this cover home sales?

Partially. The math is the same, but primary residences often qualify for a sizeable exclusion before tax applies. Subtract any exclusion from the gain before entering it here.

References & Authoritative Sources

Related Calculators

Data Sources & Benchmarks

This calculator draws on 1 independent, dated source.

15.00% Provisional
U.S. mid-tier long-term capital gains rate (2025)
Federal long-term capital gains tax rates (0% / 15% / 20%) and 2025 taxable-income breakpoints; net investment income tax (NIIT) 3.8% above MAGI thresholds
U.S. Internal Revenue Service · as of January 1, 2025
View source ↗

Methodology & Review

Ugo Candido ✓ Editor
Founder & Editor-in-Chief at CalcDomain — responsible for the methodology, sourcing, and technical review of this calculator.

Capital gains tax is the realized gain multiplied by the applicable tax rate. The calculator models a single flat rate; brackets, net investment income tax surcharges, state taxes, and offsetting losses are not separated — fold them into the effective rate you enter.

Updated