Capital Gains Tax Calculator

Short-term vs long-term capital gains tax — federal rates only.

Inputs

$
$0$500K
$
$0$1.5M

Result

Capital gains tax
$3,750.00
  • Effective rate on gain15.00%
  • After-tax gain$21,250.00
  • Long-term rate (preferential)0% / 15% / 20%
  • Taxed at 0%$0.00
  • Taxed at 15%$25,000.00 → $3,750.00
  • Taxed at 20%$0.00 → $0.00
Your long-term tax
Effective 15.00% on $25,000 gain.
$3,750.00
If short-term (ordinary)
Held ≤1 year — taxed at ordinary brackets.
$5,500.00
After-tax gain
$21,250.00
0% LT bracket ceiling
Long-term gains stacked under this threshold are tax-free.
$47,025.00 (single, 2024)
Not financial advice — Federal-only — state capital-gains rules vary widely. Excludes the 3.8% Net Investment Income Tax for higher earners (MAGI > $200k single / $250k MFJ), AMT, wash-sale rules, and § 1411/§ 121 special cases (home-sale exclusion). Collectibles and § 1250 unrecaptured gains use different rates.

How to use this calculator

  • Enter the dollar amount of your gain (sale price minus cost basis).
  • Pick short-term or long-term based on holding period.
  • Add your other taxable income — the calculator stacks the gain on top.
  • Toggle short vs long to see why holding past 1 year often saves real money.

About this tool

Capital gains tax depends on how long you held the asset before selling. Held ≤ 1 year (short-term)? Taxed at your ordinary income rate — same as your salary. Held > 1 year (long-term)? Preferential rates kick in: 0%, 15%, or 20% based on your total taxable income. The 0% bracket is bigger than people realize — for 2024, a single filer with under $47k taxable income pays zero federal tax on long-term gains. This calculator stacks the gain on top of your other income (matching how the IRS actually computes it) so the answer reflects how the brackets split your gain.

What this calculator does

Computes US federal capital gains tax on the sale of an appreciated asset (stocks, funds, crypto, real estate other than primary residence). Handles both short-term rates (ordinary income) and long-term rates (0% / 15% / 20% preferential bands), and stacks the gain on top of the other taxable income you enter to determine the correct long-term bracket. Uses 2026 brackets published in IRS Rev. Proc. 2025-32. Does not include the 3.8% Net Investment Income Tax (NIIT) for high earners or state-level capital gains tax — see the depth sections below for both.

How it works — the formula

Long-term CGT = gain × (0% or 15% or 20%, based on total taxable income); Short-term CGT = gain × marginal ordinary rate

The long-term bracket is determined by where "ordinary taxable income + long-term gain" lands within the three-band 0/15/20% structure defined by IRS §1(h). Short-term gains (held ≤ 1 year) are added to ordinary income and taxed at the taxpayer's marginal rate.

Worked examples

Example 1
Long-term gain, middle-income single filer
Inputs:
gain = $10,000 (held 3 years), other income = $75,000, filing = single
Output:
CGT = $1,500 (15% long-term rate)

Total taxable income of $85,000 lands within the 15% long-term bracket for singles ($48,350 - $533,400 in 2026).

Example 2
Short-term gain, same taxpayer
Inputs:
gain = $10,000 (held 6 months), other income = $75,000, filing = single
Output:
CGT = $2,200 (22% marginal ordinary rate)

Short-term gains are treated as ordinary income; the $10K falls entirely in the 22% bracket, costing $700 more than the long-term equivalent.

Example 3
0% long-term bracket, low-income retiree
Inputs:
gain = $30,000 long-term, other income = $20,000, filing = married filing jointly
Output:
CGT = $0 (fits entirely in the 0% long-term band)

For MFJ 2026, the 0% long-term band extends to $96,700 of taxable income. Retirees deliberately harvest gains up to this ceiling to reset cost basis tax-free.

Short-term vs long-term — the one-year holding-period line

The single most important distinction in US capital gains taxation is the holding period. Assets held for more than one year before sale qualify for long-term capital gains rates (a preferential 0%, 15%, or 20% federal rate depending on income). Assets held for one year or less generate short-term capital gains, which are taxed as ordinary income at the taxpayer's marginal rate — up to 37% in 2026.

The holding period is measured from the day AFTER acquisition through the day of sale. Buy on April 1 2025 and sell on April 1 2026: holding period is exactly one year, which counts as SHORT-TERM. Sell one day later on April 2 2026: holding period is one year and one day, which counts as LONG-TERM. This one-day precision matters enormously — the tax difference on a $50,000 gain for a middle-income taxpayer can be $3,500 or more.

The lesson is straightforward: if you are within days of the one-year mark on an appreciated position, waiting to cross the threshold is often the highest-return "decision" you can make with the position, provided you accept the market risk of the additional days.

2026 long-term capital gains brackets

The three preferential long-term rates are 0%, 15%, and 20%, with the bracket determined by total taxable income (ordinary income + long-term gains combined). The brackets are indexed annually to inflation; the 2026 amounts below are from IRS Rev. Proc. 2025-32.

2026 US federal long-term capital gains brackets (IRS Rev. Proc. 2025-32)
Filing status0% rate15% rate20% rate
Singleup to $48,350$48,351 - $533,400over $533,400
Married filing jointlyup to $96,700$96,701 - $600,050over $600,050
Married filing separatelyup to $48,350$48,351 - $300,000over $300,000
Head of householdup to $64,750$64,751 - $566,700over $566,700
Estates and trustsup to $3,250$3,251 - $15,900over $15,900
Bracket thresholds shift each year with inflation. Trusts and estates have compressed brackets — long-term capital gains inside a trust reach the 20% bracket at just $15,900 of taxable income, which is why grantor trusts and passing gains through to beneficiaries are common tax strategies.

The Net Investment Income Tax (NIIT) — 3.8% surcharge

On top of the base capital gains rate, high-income taxpayers pay an additional 3.8% Net Investment Income Tax (NIIT) under 26 USC §1411. NIIT applies to the lesser of net investment income or the amount by which Modified Adjusted Gross Income (MAGI) exceeds a threshold: $200,000 single, $250,000 married filing jointly, $125,000 married filing separately.

A single filer with $250,000 in ordinary income and a $50,000 long-term gain pays 15% on the gain ($7,500) plus 3.8% NIIT on the full $50,000 gain ($1,900), for a combined federal tax of $9,400 — an effective 18.8% federal rate on the gain. High earners in the 20% base bracket effectively pay 23.8% federal (20% + 3.8%) on their long-term gains.

NIIT applies to nearly all forms of investment income: interest, dividends, capital gains, rental income (with material-participation exceptions), and royalties. It does NOT apply to income from an active trade or business, wages, retirement account distributions, or Social Security benefits. This is why timing the sale of a large appreciated position in a low-income year can meaningfully reduce total tax by avoiding both the 20% bracket and the NIIT threshold.

Section 1250 unrecaptured gain on real estate

When you sell rental real estate at a gain, part of the gain may be "unrecaptured Section 1250 gain" — taxed at a maximum federal rate of 25% rather than the standard 15% or 20% long-term rate. This recapture applies to the portion of the gain attributable to prior depreciation deductions.

Example: you bought a rental property for $300,000, took $50,000 of depreciation deductions over ten years (reducing adjusted basis to $250,000), and sold it for $400,000. The total gain is $150,000. Of that, $50,000 is unrecaptured Section 1250 gain taxed at 25%, and the remaining $100,000 is standard long-term capital gain taxed at your normal 0/15/20% bracket. Total federal tax on the sale is $12,500 (25% × $50K) + $15,000 (15% × $100K) = $27,500.

The recapture provision limits the tax benefit landlords receive from depreciation deductions — you defer the tax during the holding period, but the deferred tax comes due at 25% at sale, potentially at a rate higher than your then-current ordinary bracket. Depreciation is still valuable (it defers tax at 100% of your then-current bracket in favour of a future 25% recapture rate), but the calculation is more nuanced than a straight long-term-rate calculation.

The wash-sale rule (§1091) on losses

A capital LOSS realised on a sale is disallowed if the taxpayer buys a "substantially identical" security within 30 days before or after the sale (a 61-day total window). The disallowed loss is added to the cost basis of the replacement position, effectively deferring the loss to a future sale of the replacement rather than eliminating it.

The wash-sale rule matters mostly for tax-loss harvesting strategies. A taxpayer wanting to book a loss on Company A while maintaining market exposure cannot simply sell A and rebuy A the next day — the loss will be disallowed. The workaround is buying a similar-but-not-substantially-identical security (a competing company in the same industry, or an ETF that overlaps but is not identical). What "substantially identical" means precisely is a matter of long-standing IRS interpretation and court rulings.

The wash-sale rule as currently written by the IRS applies to securities. It does not apply to cryptocurrency, which is classified as "property" rather than a security — though legislative proposals to extend the rule to crypto have been repeatedly introduced and may become law in future tax years. As of 2026, crypto tax-loss harvesting without a 30-day wait is legal.

Tax-loss harvesting — turning losses into tax savings

Capital losses can offset capital gains dollar-for-dollar within the same tax year. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Any remaining net loss can then offset the other category. Beyond that, up to $3,000/year of net capital loss can offset ordinary income ($1,500 if married filing separately). Losses in excess of these limits carry forward indefinitely to future years.

Tax-loss harvesting is the deliberate practice of selling losing positions to book the loss for tax purposes while maintaining broadly similar market exposure. Executed well, it can add 0.5-1.5% to after-tax annual returns in a diversified portfolio — one of the most reliable "free returns" in retail investing.

The mechanical steps: identify positions with unrealised losses greater than transaction costs, sell them, immediately purchase a similar-but-not-substantially-identical position (avoiding the wash-sale trap), and use the harvested losses to offset gains realised elsewhere in the portfolio or to reduce ordinary income up to $3,000. Automated services (Wealthfront, Betterment, most modern robo-advisors) do this systematically as part of their standard service.

Qualified dividends — same preferential rates

Not all dividends are taxed as ordinary income. "Qualified" dividends receive the same 0/15/20% preferential rate as long-term capital gains. To qualify, the dividend must come from a US corporation (or a qualified foreign corporation) and the taxpayer must have held the stock more than 60 days during the 121-day period beginning 60 days before the ex-dividend date.

Ordinary dividends — including most REIT dividends, MLP distributions, and dividends from stocks held less than the 60-day threshold — are taxed at the taxpayer's marginal ordinary rate. Your 1099-DIV separates these two categories in boxes 1a (ordinary total) and 1b (qualified portion) each January.

For high-earners, the difference between "ordinary" and "qualified" dividend tax treatment can be dramatic — 37% ordinary vs 20% qualified — which is one reason investment portfolios often prefer index-fund equity exposure (mostly-qualified dividends) over REIT-heavy income strategies (mostly-ordinary dividends).

The primary residence exclusion (§121)

Sales of a primary residence receive one of the largest tax breaks in the US tax code. Under 26 USC §121, single filers can exclude up to $250,000 of gain, and married-filing-jointly couples up to $500,000, from federal capital gains tax on the sale of a primary residence. The exclusion is available once every two years, and the taxpayer must have owned AND used the property as their primary residence for at least 2 of the 5 years preceding the sale.

This is why the capital-gains calculator above intentionally does NOT handle primary-residence sales — the vast majority of homeowners never owe any federal capital gains tax on a home sale because of the §121 exclusion. Only gains exceeding the $250K/$500K threshold trigger tax, and even then only the excess is taxed.

Note that the exclusion applies only to gain, not to the sale price. If you bought a house for $400,000, took no depreciation, and sold it for $700,000, your gain is $300,000. A single filer excludes $250,000 and pays capital gains tax on the remaining $50,000. A married couple excludes the full $300,000 with no tax owed.

State capital gains tax — the huge geographic difference

Federal capital gains tax is only part of the picture. Most US states tax capital gains as ordinary income (no special rate), some tax them at a preferential rate, and a handful do not tax capital gains at all.

US states that do NOT tax capital gains (income-tax-free states):

  • Alaska, Florida, Nevada, New Hampshire (interest/dividends only), South Dakota, Tennessee, Texas, Washington (limited — 7% tax on capital gains > $270K since 2022), Wyoming
  • Washington state's 7% capital gains tax applies only to gains above about $270,000 per taxpayer per year (indexed annually). Sales of primary residence, retirement accounts, and family farms are exempt.
  • New Hampshire taxes interest and dividends at 3% but does not tax wages or capital gains.

For taxpayers in high-tax states (California's top rate is 13.3%, New York City's combined federal + state + city rate for high earners can exceed 40%), state capital gains tax often exceeds federal — a $100,000 long-term gain for a California high earner pays 20% federal + 3.8% NIIT + 13.3% state = 37.1% combined rate. Location matters enormously for high-net-worth capital gains planning.

Common capital-gains reporting mistakes

Not reconciling 1099-B against actual basis. Broker-reported basis on your 1099-B is not always correct — brokers can miss wash-sale adjustments, gifted-stock basis, and inherited-stock step-ups. Every sale reported on Form 8949 requires the taxpayer's own basis calculation, not blind acceptance of the 1099-B.

Missing the wash-sale window. Selling for a loss in December and buying back within 30 days (either side of year-end) disallows the loss. Automated tax-loss-harvesting services usually track this, but manual investors routinely trigger inadvertent wash sales that push losses into future years.

Ignoring lot-level cost basis. When you sell part of a position, the default cost basis method is FIFO (first-in-first-out) unless you specify otherwise at the time of sale. Choosing specific-lot identification (selling higher-cost lots first) can meaningfully reduce the reported gain — but you must document the selection at the time of the trade, not after.

Not tracking cryptocurrency basis. Every crypto trade — including swaps between cryptocurrencies and any use of crypto to buy goods or services — is a taxable event with a required basis calculation. Crypto exchanges have historically provided very poor basis reporting; taxpayers are responsible for maintaining their own records.

When to use this vs other tools

Capital gains tax intersects with a lot of other calculations. Reach for a related tool when the situation calls for it.

  • Tax Bracket Calculator

    Use to see your marginal and effective ordinary-income tax rate before adding capital gains — the ordinary-income figure determines your long-term bracket.

  • Investment Return Calculator

    Use for the pre-tax return calculation on an investment. Combine with this capital-gains calculator to get the after-tax return.

  • 401(k) Calculator

    Use to see the retirement-account alternative — 401(k) growth is tax-deferred and avoids capital gains tax entirely on internal rebalancing.

Authority note

Internal Revenue Service (IRS)

Pub 550 is the definitive plain-language reference for how US federal capital gains tax works on securities and other investment property. The 2026 bracket amounts come from Rev. Proc. 2025-32, published fall 2025 as required by 26 USC §1(f).

Limitations

  • US federal calculation only — state capital gains tax and the 3.8% NIIT are not included in the headline number. See depth sections below for both.
  • Assumes the gain is a "regular" capital gain — collectibles (28% max rate), Section 1250 unrecaptured depreciation on real estate (25% max rate), and Qualified Small Business Stock (§1202 exclusion) all have special treatment not modeled.
  • Wash-sale rules (§1091) can defer losses if a substantially identical security is repurchased within 30 days — this calculator does not check for wash-sale exposure.
  • The calculator does not track cost basis history, brokerage-reported basis vs actual basis, or specific-lot identification decisions.

Capital gains tax is highly fact-specific. This calculator does not provide tax advice — consult a CPA or Enrolled Agent for any transaction above modest amounts, and always cross-check against your brokerage 1099-B and Form 8949 filings.

Frequently asked

US tax policy historically rewards long-term investment vs. short-term trading. The preferential rates are 0%, 15%, 20% for long-term; short-term is just your ordinary income rate (10-37%).

Related calculators

Embed this tool on your site
Free, mobile-responsive iframe. Copy-paste a one-line snippet.
Get embed code →

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.