Capital Gains Tax Calculator

Holding period, filing status, taxable income, and NIIT decide the real after-tax gain.

The short answer

How much tax you owe depends on one year of holding.

If you held the asset more than one year, your profit is a long-term capital gain taxed at the preferential federal rates of 0%, 15%, or 20% depending on your total taxable income. If you held it one year or less, it is a short-term gain taxed as ordinary income at rates up to 37%. High earners also owe an extra 3.8% Net Investment Income Tax (NIIT). This calculator models the long-term federal case for 2025 — change the gain, your other income, and filing status above and the result updates instantly.

The one-year line

Selling on day 365 is short-term. Selling on day 366 is long-term. On a $50,000 gain for a typical earner that line is the difference between a ~22–24% ordinary rate and a 15% long-term rate — roughly $4,000+ of tax. Patience is a tax strategy.

How it works

The 2025 long-term brackets stack on your taxable income.

Long-term gains are not taxed in isolation — they sit on top of your other taxable income and fall into 0%, 15%, or 20% bands based on the 2025 thresholds. The NIIT is a separate 3.8% surtax that triggers when modified AGI crosses $200,000 (single) or $250,000 (married filing jointly).

2025 long-term rateSingle taxable incomeMarried filing jointly
0%Up to $48,350Up to $96,700
15%$48,351 – $533,400$96,701 – $600,050
20%Over $533,400Over $600,050
+ 3.8% NIITMAGI over $200,000MAGI over $250,000
2025 IRS thresholds. Short-term gains are taxed as ordinary income instead and are not shown here.
The math

The formula behind the result.

Tax = (Gain × LT rate) + (NIIT applies ? Gain × 0.038 : 0)
  • Gain — your realized long-term capital gain
  • LT rate — 0%, 15%, or 20% from the bracket table, by filing status and total income
  • NIIT — extra 3.8% when MAGI (other income + gain) exceeds $200k single / $250k joint
  • After-tax — Gain − Tax − NIIT
A worked example

$50,000 gain, $120,000 income, single filer.

Walk it by hand
1. Total taxable income $120,000 is above $48,350 but below $533,400, so the long-term rate is 15%.
2. Federal capital gains tax: $50,000 × 15% = $7,500.
3. NIIT check: income + gain = $170,000, which is below the $200,000 single threshold, so NIIT = $0.
4. After-tax gain: $50,000 − $7,500 − $0 = $42,500.
Federal tax $7,500 · NIIT $0 · After-tax $42,500 · Effective rate 15.0%

Raise other income above $533,400 and the rate jumps to 20%; cross the $200,000 MAGI line and the 3.8% NIIT adds on top, pushing the effective federal rate toward 23.8%.

Glossary

Capital gains terms, decoded.

Cost basis
What you paid for the asset plus commissions and qualifying improvements. Gain = sale price − cost basis.
Realized vs unrealized gain
An unrealized gain is paper profit on something you still own — it is not taxed. Tax applies only when you sell and the gain is realized.
Holding period
Time from the day after purchase to the sale date. More than one year is long-term; one year or less is short-term.
NIIT
Net Investment Income Tax — a 3.8% surtax on investment income above $200k single / $250k joint MAGI.
Section 121 exclusion
Lets you exclude up to $250k ($500k joint) of gain on a primary residence owned and lived in 2 of the last 5 years.
Tax-loss harvesting
Selling losing positions to realize losses that offset gains, plus up to $3,000 of ordinary income per year.
Wash sale
Repurchasing a substantially identical security within 30 days of a loss sale, which disallows the loss for that year.
Step-up in basis
An inherited asset's basis resets to its fair market value at the prior owner's death, often erasing built-up gain.
FAQ

Capital gains questions, answered.

It is the holding period. Sell an asset you owned one year or less and the gain is short-term, taxed at your ordinary income rates (up to 37%). Hold it longer than one year and the gain is long-term, taxed at the preferential 0%, 15%, or 20% federal rates. The clock starts the day after you acquire the asset and ends on the day you sell.

For 2025, single filers with taxable income up to $48,350 and married-filing-jointly couples up to $96,700 pay 0% on long-term gains. Because the brackets count total taxable income including the gain, a large gain can push part of itself into the 15% band even when your other income is low.

More than one year. Exactly one year still counts as short-term. The IRS measures from the day after the trade date you bought to the trade date you sold, so one year and one day is the minimum for the long-term rate.

The NIIT is an extra 3.8% surtax on net investment income, including capital gains, that applies when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). It layers on top of the 0/15/20% rate, so a high earner in the 20% bracket effectively pays 23.8% federally.

The Section 121 exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) on the sale of a primary residence, provided you owned and lived in it for at least two of the last five years. Gain above the exclusion is taxed at long-term capital gains rates.

Realized capital losses first offset capital gains of the same type, then the other type, and up to $3,000 of net loss can offset ordinary income each year. Unused losses carry forward indefinitely. Deliberately selling losing positions to bank those losses is called tax-loss harvesting.

If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss for that tax year. The disallowed loss is added to the basis of the replacement shares, deferring rather than erasing it.

When you inherit an asset, its cost basis is reset to its fair market value on the date of the original owner's death. If you sell soon after, the taxable gain is often near zero because it is measured from the stepped-up value, not the decedent's original purchase price.

No. It models only the federal long-term capital gains brackets and the federal NIIT. Most states tax capital gains as ordinary income at their own rates, so your total bill can be higher depending on where you live.

No. The calculator runs entirely in your browser and nothing is sent to a server. Share links include the numbers as visible URL parameters, so avoid sharing a link if the figures are private.

Sources

What we read so you don't have to.

Methodology

Educational only — not tax or financial advice. This tool models federal long-term capital gains and NIIT for 2025 and excludes state tax, short-term gains, the 28% collectibles rate, qualified small business stock, and credits. Confirm your situation with a CPA or enrolled agent before filing.

Related

Related calculators