Capital Gains Tax Calculator
✦ Finance & MoneyUse this capital gains tax calculator to see the federal tax on a gain stacked on your income across the 0/15/20 % layers, plus the 3.8 % NIIT. The short-term capital gains tax calculator tab taxes the same gain at ordinary rates.
- ✓ Calculated in your browser
- ✓ Nothing you type is stored
- ✓ No sign-up required
- ✓ Formula and sources shown
The formula
Federal long-term capital gains tax — IRC §1(h) stacking
Room at 0 % = max(0, zero-rate ceiling[status] − ordinary taxable income)
Gain at 0 % = min(gain, room at 0 %)
Room at 15 % = max(0, 15 %-ceiling[status] − max(ordinary income, zero-rate ceiling))
Gain at 15 % = min(gain − gain at 0 %, room at 15 %)
Gain at 20 % = gain − gain at 0 % − gain at 15 %
LTCG tax = gain at 15 % × 0.15 + gain at 20 % × 0.20
NIIT = 0.038 × min(gain, MAGI − NIIT threshold[status]) (0 if negative)
Short-term = Tax(ordinary income + gain) − Tax(ordinary income) at the ordinary brackets
Ordinary taxable income is your income after the standard or itemised deduction, before the gain. For 2026 the zero-rate ceiling is $49,450 (single), $98,900 (married filing jointly) or $66,200 (head of household) and the 15 % ceiling is $545,500, $613,700 or $579,600 (IRS Rev. Proc. 2025-32). The NIIT threshold is $200,000 ($250,000 joint); MAGI is estimated as taxable income + the standard deduction + the gain unless you enter it. Behind Advanced: the §121 home-sale exclusion, and the 25 % (unrecaptured §1250) and 28 % (collectibles) maximum rates, which the Schedule D Tax Worksheet caps at what ordinary rates would charge.
Calculating it by hand
- Pick Long-term (held more than one year) or Short-term (one year or less) — the two paths are different calculations.
- Select your filing status; it sets the 0 % and 15 % ceilings, the ordinary brackets and the NIIT threshold.
- Enter your ordinary taxable income before the gain — Form 1040 line 15 minus this gain — and the capital gain amount (proceeds minus adjusted basis and selling costs).
- Long-term: subtract your ordinary income from the zero-rate ceiling; that much of the gain is taxed at 0 %. Fill the 15 % layer up to its ceiling, and tax anything above it at 20 %.
- Short-term: compute ordinary income tax with and without the gain through the brackets; the difference is the tax on the gain.
- Add the NIIT: 3.8 % of the smaller of the gain and the amount by which your modified AGI exceeds $200,000 (single or head of household) or $250,000 (married filing jointly).
- In Advanced, add your state rate, apply the §121 exclusion on a main-home sale, or mark the gain as collectibles (28 % maximum) or enter the unrecaptured §1250 part (25 % maximum).
Worked examples
Single filer, $45,000 ordinary taxable income, $20,000 long-term gain
Inputs: Long-term · Single · ordinary taxable income $45,000 · gain $20,000Room at 0 % = $49,450 − $45,000 = $4,450 → $4,450 of the gain at 0 % = $0At 15 %: $20,000 − $4,450 = $15,550 × 0.15 = $2,332.50NIIT: estimated MAGI = $45,000 + $16,100 + $20,000 = $81,100 < $200,000 → $0Federal capital gains tax = $2,332.50 (11.7 % of the gain)
Federal capital gains tax $2,332.50 — 11.7 % of the gain. The gain spans the 0 % and 15 % layers; held short-term instead it would be $3,860.
Married couple sells their home: $150,000 ordinary income, $600,000 gain, §121 exclusion
Inputs: Long-term · Married filing jointly · ordinary taxable income $150,000 · gain $600,000 · Advanced: §121 exclusion = YesTaxable gain = $600,000 − $500,000 exclusion = $100,000Room at 0 % = max(0, $98,900 − $150,000) = $0; room at 15 % = $613,700 − $150,000 = $463,700At 15 %: $100,000 × 0.15 = $15,000; nothing reaches 20 %NIIT: estimated MAGI = $150,000 + $32,200 + $100,000 = $282,200; excess over $250,000 = $32,200; 0.038 × min($100,000, $32,200) = $1,223.60Federal capital gains tax = $15,000 + $1,223.60 = $16,223.60
Federal capital gains tax $16,223.60 — 2.7 % of the $600,000 gain after the $500,000 exclusion, including $1,223.60 of NIIT.
Short-term vs long-term: single filer, $60,000 ordinary income, $20,000 gain
Inputs: Single · ordinary taxable income $60,000 · gain $20,000 · switch between the Short-term and Long-term tabsShort-term — tax at ordinary rates: Tax($80,000) − Tax($60,000) with the 2026 single bracketsTax($60,000) = 10 % × $12,400 + 12 % × $38,000 + 22 % × $9,600 = $1,240 + $4,560 + $2,112 = $7,912Tax($80,000) = $7,912 + 22 % × $20,000 = $12,312 → short-term tax = $4,400 (22 % marginal)Long-term — $60,000 is above the $49,450 zero-rate ceiling, so all $20,000 is at 15 % = $3,000NIIT: estimated MAGI $96,100 < $200,000 → $0 on either path
Short-term $4,400 · long-term $3,000. Holding the asset past one year saves $1,400 — 7 % of the gain.
Methodology
How capital gains tax is actually calculated
There is no single capital gains rate. The gain is stacked on top of your ordinary income, so the first dollars of it can be taxed at 0 % while the last are taxed at 20 % — and the 3.8 % NIIT is a separate test on a different income figure.
Read sources and limitsWhat a capital gains tax calculator works out
A capital gains tax calculator works out the federal tax on the profit from selling an asset by stacking the gain on your ordinary taxable income and taxing it layer by layer — 0 %, 15 % or 20 % when held over a year, ordinary rates when held a year or less — plus the 3.8 % NIIT above the MAGI threshold.
This page starts from a gain you already know. The companion capital gains calculator on this site works the gain itself out from purchase price, sale price, costs and holding period; this one takes that figure and tells you the tax on it, including the home-sale exclusion, the collectibles and depreciation-recapture rates, and a reader-entered state rate. Nothing you enter leaves your browser.
How much is capital gains tax on $50,000?
For a single filer with $80,000 of ordinary taxable income in 2026, a $50,000 long-term gain is taxed entirely in the 15 % layer: $7,500, or 15 % of the gain. The same gain for a single filer with $40,000 of ordinary income is cheaper, because $9,450 of it fills the room left below the $49,450 zero-rate ceiling: only $40,550 is taxed at 15 %, so the tax is $6,082.50 — an effective 12.2 % on the gain.
At the top end the gain spans two layers. A single filer with $520,000 of ordinary income pays 15 % on the $25,500 that fits below the $545,500 ceiling ($3,825) and 20 % on the remaining $24,500 ($4,900), plus the NIIT on the whole $50,000 ($1,900), for $10,625 in total — 21.3 % of the gain. Held a year or less, that same $50,000 would be taxed at ordinary rates instead: $11,086 for the $60,000 earner (22 % on $45,700, then 24 % on $4,300) against $7,500 long-term.
Long-term capital gains tax rates for 2026: the 0 %, 15 % and 20 % thresholds
IRS Rev. Proc. 2025-32 sets the 2026 breakpoints. The 0 % rate applies while taxable income including the gain is at or below $49,450 for single filers, $98,900 for married filing jointly and $66,200 for head of household. The 15 % rate runs up to $545,500 (single), $613,700 (married filing jointly) or $579,600 (head of household); any gain above those amounts is taxed at 20 %. The calculator reads the figures for the tax year you pick, so a 2027 selection will use the 2027 amounts once they are published and verified.
The breakpoints are tested against taxable income with the gain included, which is why ordinary income matters so much. A single filer with $30,000 of ordinary taxable income has $19,450 of room at 0 %: selling appreciated stock to realise exactly that much gain costs nothing in federal tax, and the next dollar is taxed at 15 cents. A married couple with $120,000 of ordinary income has no 0 % room left, so an $80,000 gain is taxed at 15 % throughout — $12,000.
Married filing jointly thresholds are exactly double the single thresholds at 0 % but not at 15 % ($613,700 against $545,500), and the NIIT threshold is only $250,000 against $200,000 — so a couple with a large gain can reach the NIIT before the 20 % rate.
Short-term capital gains tax calculator: the same gain at ordinary rates
A gain on an asset held one year or less gets no preferential rate. It is added to your ordinary income and taxed in whichever brackets it reaches, so the tax is the difference between income tax on (ordinary income + gain) and income tax on ordinary income alone. For a single filer with $85,000 of ordinary taxable income, a $20,000 short-term gain sits entirely in the 22 % bracket: $4,400. Held one day longer, the same gain is a long-term gain taxed at 15 %: $3,000. The calculator shows both figures side by side whichever path you pick, so the value of waiting is always visible.
The holding period runs from the day after you acquired the asset to the day you sold it; more than one year means the anniversary date or later. The NIIT applies to short-term gains in exactly the same way as to long-term gains, so a high earner can pay 37 % + 3.8 % = 40.8 % on a short-term gain.
What is the net investment income tax (NIIT) and when does the 3.8 % apply?
The NIIT under IRC §1411 (Form 8960) is 3.8 % of the smaller of two amounts: your net investment income — which includes capital gains, interest, dividends and rental income — and the amount by which your modified adjusted gross income exceeds $200,000 (single and head of household) or $250,000 (married filing jointly). The thresholds are fixed in law and never indexed, so they catch more people each year.
MAGI is not the taxable income the layers use: it is adjusted gross income before the standard deduction (plus any excluded foreign earned income). Unless you enter your MAGI in Advanced, the calculator estimates it as ordinary taxable income + the standard deduction + the gain. A single filer with $180,000 of ordinary taxable income and a $50,000 gain has an estimated MAGI of $246,100, so $46,100 of the gain is above the threshold and the NIIT is $1,751.80 on top of the $7,500 at 15 % — 18.5 % of the gain in all. With $250,000 of ordinary income the whole gain is over the line: $1,900, for a combined 18.8 %. The calculator treats the gain as your only investment income; other investment income raises the NIIT base.
Capital gains tax on a home sale, collectibles and depreciated rental property
Selling your main home: IRC §121 excludes up to $250,000 of gain ($500,000 married filing jointly) if you owned and lived in the home for at least two of the five years before the sale and have not used the exclusion in the previous two years. Turn it on in Advanced and the calculator subtracts it before taxing the rest. A couple with $150,000 of ordinary income and a $600,000 gain is taxed on $100,000: $15,000 at 15 %, plus $1,223.60 of NIIT because their estimated MAGI of $282,200 is $32,200 over the joint threshold — $16,223.60, or 2.7 % of the whole gain. Partial exclusions for a job move, health or unforeseen circumstances are in IRS Pub 523 and are not modelled.
Collectibles — art, coins, stamps, antiques, gems, precious metals — held more than a year are taxed at your ordinary rate up to a maximum of 28 % instead of 0/15/20 %. Unrecaptured §1250 gain — the part of a gain on a depreciated building equal to the straight-line depreciation you claimed — is taxed at ordinary rates up to a maximum of 25 %, and the rest of the gain stacks above it in the normal layers. Both are maximums: the Schedule D Tax Worksheet never charges more than ordinary rates would, which is why a single filer with $30,000 of ordinary income pays $1,200 (12 %), not $2,800, on a $10,000 collectibles gain. The calculator applies that cap.
What is simplified: the gain is treated as your only capital transaction, so losses, carryovers and qualified dividends are not netted; married filing separately is not offered; the alternative minimum tax is not checked (the AMT calculator is separate); and the state figure is whatever rate you enter, applied flat to the taxable gain — most states tax gains as ordinary income at their own brackets, and a few exclude part of a long-term gain.
Capital Gains Tax questions
What is the capital gains tax rate for 2026?
Long-term gains are taxed at 0 %, 15 % or 20 % in 2026, depending on where the gain lands stacked on your taxable income: 0 % up to $49,450 (single), $98,900 (married filing jointly) or $66,200 (head of household); 15 % up to $545,500, $613,700 or $579,600; 20 % above that. Short-term gains are taxed at ordinary rates of 10 % to 37 %. The 3.8 % NIIT applies above $200,000 of modified AGI ($250,000 joint), so the top long-term rate is 23.8 %. Source: IRS Rev. Proc. 2025-32.
How much is capital gains tax on $100,000?
$15,000 for most people: a $100,000 long-term gain for a single filer with $100,000 of ordinary taxable income is taxed at 15 % throughout, plus $611.80 of NIIT because estimated MAGI ($216,100) is $16,100 over the $200,000 threshold — $15,611.80 in all. A married couple with the same ordinary income pays $15,000 and no NIIT, since their estimated MAGI of $232,200 is under $250,000. Someone with little other income pays far less, because the first dollars of the gain fill the 0 % layer.
How is capital gains tax calculated?
Take your ordinary taxable income, then add the gain on top. Any part of the gain that fits under the zero-rate ceiling for your filing status is taxed at 0 %, the part up to the 15 % ceiling at 15 %, and the rest at 20 %. Then add the NIIT: 3.8 % of the smaller of the gain and your modified AGI over $200,000 ($250,000 joint). A short-term gain skips the layers: the tax is the difference between income tax with and without the gain.
Do I pay capital gains tax if I reinvest the money?
Yes. Federal tax is due on a gain when you sell, whatever you do with the proceeds — buying another stock, fund or coin does not defer it. The exceptions are specific: a like-kind (§1031) exchange of investment real estate, a qualified opportunity-fund investment, and sales inside an IRA, 401(k) or other tax-advantaged account, where trades create no taxable gain at all. Reinvested dividends inside a taxable brokerage account are also taxed in the year paid.
Does capital gains tax depend on my income?
Entirely. Your ordinary taxable income fills the brackets first and the gain sits on top, so the same $20,000 long-term gain costs a single filer $0 at $29,000 of other income, $1,582.50 at $40,000 (where $9,450 fits under the $49,450 ceiling) and $3,000 at $60,000 or more. Above $545,500 of combined income any further gain is taxed at 20 %. That is why this calculator asks for your ordinary taxable income rather than quoting a single rate.
What is the difference between short-term and long-term capital gains tax?
Held one year or less, a gain is short-term and taxed at your ordinary rate; held more than one year it is long-term and taxed at 0 %, 15 % or 20 %. On a $50,000 gain for a single filer with $60,000 of ordinary taxable income, short-term tax is $11,086 (22 % on $45,700, then 24 % on $4,300) and long-term tax is $7,500 — $3,586 for crossing the one-year mark. The holding period starts the day after you buy; a sale on the anniversary date is still short-term.
How do I avoid capital gains tax on a home sale?
Up to $250,000 of gain ($500,000 married filing jointly) on your main home is excluded under IRC §121 if you owned and lived in it for two of the five years before the sale and have not used the exclusion in the last two years. Only the gain above the exclusion is taxed, as a long-term gain: a couple with a $600,000 gain and $150,000 of other taxable income pays $16,223.60 on the $100,000 that remains, including NIIT. A rental or second home gets no exclusion. Source: IRS Pub 523.
What is the net investment income tax and who pays it?
The NIIT is a 3.8 % federal tax on investment income — capital gains, interest, dividends, rents — for taxpayers whose modified AGI exceeds $200,000 (single, head of household) or $250,000 (married filing jointly). It is charged on the smaller of your net investment income and the amount of MAGI over the threshold, and it applies to short-term and long-term gains alike. A single filer with $250,000 of ordinary taxable income pays it on all of a $50,000 gain: $1,900. Source: Form 8960 Instructions, IRS Topic 559.
Do states tax capital gains too?
Most do, as ordinary income at the state's own rates — from a flat 2.5 % to 13.3 % at the top in California — and a few give long-term gains a partial exclusion or a lower rate. Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas and Wyoming tax no capital gains; Washington taxes only large long-term gains above an inflation-indexed threshold. Enter your state's rate in Advanced and the calculator applies it to the taxable gain; it never assumes a state rate for you.
Are collectibles taxed at a different capital gains rate?
Yes: long-term gains on collectibles — art, coins, stamps, antiques, gems and precious metals — are taxed at your ordinary rate up to a 28 % maximum rather than 0/15/20 %. A single filer with $200,000 of ordinary income pays $2,800 on a $10,000 collectibles gain (plus $380 of NIIT); one with $30,000 of ordinary income pays $1,200, because 12 % is their ordinary rate and 28 % is only a ceiling. Short-term collectibles gains are ordinary income like any other short-term gain. Source: IRC §1(h)(5), IRS Topic 409.
What is unrecaptured §1250 gain on a rental property sale?
It is the part of the gain on a depreciated building equal to the straight-line depreciation you claimed, and it is taxed at ordinary rates up to a 25 % maximum instead of 0/15/20 %. A single filer with $100,000 of ordinary income and a $60,000 rental gain of which $20,000 is depreciation pays 25 % on the $20,000 ($5,000) and 15 % on the other $40,000 ($6,000) — $11,000. Enter the depreciation part in Advanced; the rest stacks above it. Source: IRS Topic 409, Schedule D instructions.
Do I pay capital gains tax on stocks sold inside an IRA or 401(k)?
No. Sales inside a traditional IRA, Roth IRA, 401(k) or 403(b) are not taxable events, and holding periods do not matter there. Traditional-account withdrawals are taxed later as ordinary income; qualified Roth withdrawals are tax-free. Losses inside these accounts cannot be deducted. This calculator is for gains in a taxable brokerage account or on property you own directly. Source: IRS Topic 409.
Source notes
Method, sources & limitations
Every figure on this page comes from the formula above applied to the values you enter. Nothing is estimated from market data, and no result is a forecast. These are the sources behind the method and any fixed figures it uses:
- IRS Topic No. 409 — Capital Gains and Losses
- IRS Rev. Proc. 2025-32 — 2026 inflation adjustments (§3.03, maximum zero-rate and 15 %-rate amounts)
- IRS Instructions for Schedule D (Form 1040) — Schedule D Tax Worksheet (25 % and 28 % rate gains)
- IRS Instructions for Form 8960 — Net Investment Income Tax
- IRS Topic No. 559 — Net Investment Income Tax
- IRS Publication 523 — Selling Your Home (§121 exclusion)
- IRS Publication 550 — Investment Income and Expenses
Educational information only. Results are estimates produced from the assumptions you enter, and are not financial, tax, legal or medical advice. Check anything that matters against a qualified professional and the cited sources.