Capital Gains Tax Calculator (Federal, Stocks, 2026)

Estimate the 2026 federal income tax on selling a stock, ETF or fund at a gain. Long-term gains are stacked on top of your other taxable income across the 0%, 15% and 20% rates the way the IRS worksheet does it; short-term gains are taxed at ordinary rates. Every bracket figure comes from the IRS and is cited below.

Estimate for education only, not tax advice. Check with a tax professional or IRS guidance. US federal tax only, 2026 figures, one sale.
$
What you paid in total, usually including commissions. Your broker's Form 1099-B often shows it.
$
What you received in total, minus selling fees.
Qualifying surviving spouse: choose married filing jointly (the IRS uses the same figures).
$
Your other 2026 taxable income after deductions (wages, interest and so on, minus the standard or itemized deduction), not counting this sale.
Uses taxable income + the gain as a rough stand-in for MAGI. See the notes below.

Results update as you type. The page URL always contains your inputs, so you can bookmark or share it.

Results

How the tax on this sale is worked out

How it's calculated

Estimate for education only, not tax advice. Check with a tax professional or IRS guidance.

Gain (or loss) = sale proceeds − cost basis Long-term = held more than 1 year; otherwise short-term Short-term gain: tax = regular tax(income + gain) − regular tax(income) Long-term gain (IRS Qualified Dividends and Capital Gain Tax Worksheet): line 1 taxable income including the gain line 5 ordinary part = line 1 − gain line 9 taxed at 0% = min(line 1, 0% maximum) − min(line 5, 0% maximum) line 17 taxed at 15% = min(gain − line 9, max(0, min(line 1, 15% maximum) − line 5 − line 9)) line 20 taxed at 20% = gain − line 9 − line 17 line 25 tax = smaller of (15% × line 17 + 20% × line 20 + regular tax(line 5)) or regular tax(line 1) tax on the gain = line 25 − regular tax(income) Net Investment Income Tax (optional estimate): NIIT = 3.8% × min(gain, max(0, MAGI − threshold)), MAGI ≈ taxable income + gain Effective rate on the gain = tax on the gain ÷ gain

2026 long-term capital gain rates (taxable income including the gain)

RateSingleMarried filing jointlyMarried filing separatelyHead of household
0%Up to $49,450Up to $98,900Up to $49,450Up to $66,200
15%$49,450 – $545,500$98,900 – $613,700$49,450 – $306,850$66,200 – $579,600
20%Over $545,500Over $613,700Over $306,850Over $579,600

2026 ordinary income tax brackets (used for short-term gains)

RateSingleMarried filing jointlyMarried filing separatelyHead of household
10%$0 – $12,400$0 – $24,800$0 – $12,400$0 – $17,700
12%$12,400 – $50,400$24,800 – $100,800$12,400 – $50,400$17,700 – $67,450
22%$50,400 – $105,700$100,800 – $211,400$50,400 – $105,700$67,450 – $105,700
24%$105,700 – $201,775$211,400 – $403,550$105,700 – $201,775$105,700 – $201,750
32%$201,775 – $256,225$403,550 – $512,450$201,775 – $256,225$201,750 – $256,200
35%$256,225 – $640,600$512,450 – $768,700$256,225 – $384,350$256,200 – $640,600
37%Over $640,600Over $768,700Over $384,350Over $640,600

Sources (checked 2026-10-19)

What this calculator does not include

Worked examples

1. Single, $60,000 of other income, $10,000 long-term gain

Taxable income before the sale is $60,000, already above the $49,450 single 0% maximum, so the 0% band is full. The whole $10,000 gain falls in the 15% band (it ends at $545,500): 15% × $10,000 = $1,500.00, an effective rate of 15.00%. Check with the worksheet: regular tax on $60,000 is $7,912.00; plus $1,500.00 = $9,412.00, which is less than the $10,112.00 regular tax on $70,000, so line 25 is $9,412.00 and the gain adds $1,500.00. Load this example

2. A gain that straddles the 0% and 15% rates

Single, $40,000 of other taxable income, $20,000 long-term gain. The 0% band runs to $49,450, so $49,450 − $40,000 = $9,450.00 of the gain is taxed at 0% and the other $10,550.00 at 15%: 15% × 10,550.00 = $1,582.50, an effective rate of 7.91%. Load this example

3. The same gain, short-term

Held a year or less, the $20,000 is ordinary income. It fills the 12% bracket from $40,000 to $50,400 and the rest is taxed at 22%: 12% × 10,400.00 + 22% × 9,600.00 = $1,248.00 + $2,112.00 = $3,360.00 (regular tax on $60,000 minus regular tax on $40,000), an effective rate of 16.80%. Holding more than a year would cost $1,582.50 instead. Load this example

4. Married filing jointly, high income, with the NIIT

$600,000 of other taxable income and a $100,000 long-term gain. The 15% band ends at $613,700, so $13,700.00 is taxed at 15% ($2,055.00) and $86,300.00 at 20% ($17,260.00): $19,315.00 of income tax. Estimated MAGI ($700,000) is well over the $250,000 threshold, so the NIIT estimate is 3.8% × $100,000 = $3,800.00. Total: $23,115.00, an effective rate of 23.12%. Load this example

5. Selling at a loss

Single, $60,000 of other income, bought for $10,000 and sold for $2,000 after more than a year: an $8,000 long-term loss and no tax on the sale. Up to $3,000 can be deducted against ordinary income this year, which at the 22% bracket lowers the estimated tax by $660.00. The other $5,000.00 carries forward as a long-term loss. Load this example

6. Why a long-term gain can be taxed at 12%

Single, exactly $49,450 of other taxable income and a $950.00 long-term gain. At capital gain rates the gain would cost 15% × 950.00 = $142.50, so line 23 is $5,828.50. But the regular tax on $50,400 (line 24) is only $5,800.00, because that income is still in the 12% bracket. Line 25 takes the smaller, so the gain adds 12% × 950.00 = $114.00. Load this example

Frequently asked questions

What are the 2026 long-term capital gains tax brackets?

For 2026, long-term gains are taxed at 0% while taxable income (including the gain) is up to $49,450 for single or married filing separately, $98,900 for married filing jointly and $66,200 for head of household. The 15% rate applies above that up to $545,500 (single), $306,850 (married filing separately), $613,700 (married filing jointly) and $579,600 (head of household), and 20% above those amounts. Source: IRS Rev. Proc. 2025-32, section 4.03.

How is capital gains tax calculated on a stock sale?

Subtract your cost basis from the sale proceeds. If you held the shares more than a year, the gain is long-term and is stacked on top of your other taxable income across the 0%, 15% and 20% rates. If you held them a year or less, it is short-term and taxed at your ordinary income tax rates. This calculator does both and shows each step.

Does a capital gain push my other income into a higher bracket?

Not for the federal income tax on that other income: long-term gains are stacked on top, so your wages are taxed the same either way. A short-term gain is added to ordinary income, so it is taxed at the brackets above your other income. A gain can still raise your AGI, which can affect the NIIT, deductions and credits.

What counts as long-term?

Generally, holding an asset for more than one year. Count from the day after you bought it through the day you sold it (IRS Topic 409). Shares bought on March 5, 2025 and sold on March 5, 2026 are short-term; sold on March 6, 2026, they are long-term.

Who pays the 3.8% Net Investment Income Tax?

Individuals with net investment income and modified adjusted gross income over $200,000 (single or head of household), $250,000 (married filing jointly or qualifying surviving spouse) or $125,000 (married filing separately). The tax is 3.8% of the smaller of the investment income or the amount over the threshold. The IRS notes these thresholds are not indexed for inflation (IRS Topic 559). This calculator's NIIT figure is an estimate.

What if I sold at a loss?

There is no tax on a loss. After offsetting any capital gains, up to $3,000 of net capital loss a year ($1,500 if married filing separately) can be deducted from other income, and the rest carries forward (IRS Topic 409). To combine several gains and losses, use the tax-loss offset calculator.

Is this my exact tax bill?

No. It is an educational estimate for one sale under federal rules. State tax, AMT, other gains and losses, qualified dividends, deductions and credits that change with income, and special rules for collectibles, real estate and small business stock are not included. Check with a tax professional or IRS guidance.

Spotted an error?

Accuracy matters more than anything else here. If a number, formula or explanation on this page looks wrong, please email a correction. The email opens with this page's link, including your current inputs, already filled in. What to include in a report.

More calculators

Disclaimer: InvestorMath calculators give educational estimates, not financial, investment or tax advice. Results depend entirely on the assumptions you enter; real returns vary and are not guaranteed, and past performance does not predict future results. Check important decisions with a qualified professional.