Capital gains tax on stocks calculator
How much capital gains tax do you owe on a stock sale? Enter the shares, buy and sell prices and holding period to see the 0/15/20% bands, the short-term rates, NIIT and your after-tax proceeds.
★ MONEY · STOCKS · CAPITAL GAINS TAX 2026
Total tax $900.00 — 15% band; after-tax proceeds $15,100.00. On 200 shares bought at $50.00 and sold at $80.00, the $80,000 of other income already fills the 0% band, so the whole $6,000 gain falls in the 15% band. Enter your numbers to see your tax.
How much capital gains tax do you owe on a stock sale? Enter the shares, buy and sell prices and holding period to see the 0/15/20% bands, the short-term rates, NIIT and your after-tax proceeds.
A stock sale is taxed on the gain: shares times the difference between the sell price and the buy price. How much of that gain you keep depends on how long you held the shares and how much other income you have. Held more than a year, the gain is long-term and taxed at 0%, 15% or 20%, stacking on top of your other taxable income. Held a year or less, it is short-term and taxed like wages, at the ordinary rates. On the defaults — 200 shares, buy price $50.00, sell price $80.00, holding period long-term, filing status single, other taxable income $80,000, state tax rate 0% — the gain is $6,000.00. The 0% band ends at $49,450.00 for a single filer, and the $80,000.00 of other income already fills it, so $0.00 falls in the 0% band and the whole $6,000.00 falls in the 15% band: the federal tax is $900.00. The NIIT is $0.00 — MAGI is $86,000.00, below the $200,000.00 threshold. The total tax is $900.00, the effective rate is 15.00%, the sale proceeds are $16,000.00 and the after-tax proceeds are $15,100.00.
| Scenario | Gain | Federal tax | Total tax | After-tax proceeds | Verdict |
|---|---|---|---|---|---|
| Default (200 shares, $50 to $80, long-term) | $6,000.00 | $900.00 | $900.00 | $15,100.00 | 15% band |
| Sell $50 | $0.00 | $0.00 | $0.00 | $10,000.00 | $0 tax — no gain, nothing taxable |
| Sell $120 | $14,000.00 | $2,100.00 | $2,100.00 | $21,900.00 | 15% band |
| Sell $200 | $30,000.00 | $4,500.00 | $4,500.00 | $35,500.00 | 15% band |
| Sell $2,500 | $490,000.00 | $74,725.00 | $88,785.00 | $411,215.00 | 20% band reached |
| Short-term | $6,000.00 | $1,320.00 | $1,320.00 | $14,680.00 | 22% band (short-term) |
| Short-term, other income $100,000, sell $300 | $50,000.00 | $11,886.00 | $11,886.00 | $48,114.00 | 22% and 24% bands (short-term) |
| Married filing jointly | $6,000.00 | $0.00 | $0.00 | $16,000.00 | 0% band only — $0 tax |
| Other income $30,000 | $6,000.00 | $0.00 | $0.00 | $16,000.00 | 0% band only — $0 tax |
| Other income $545,500 | $6,000.00 | $1,200.00 | $1,428.00 | $14,572.00 | 20% band reached |
| State tax 5% | $6,000.00 | $900.00 | $1,200.00 | $14,800.00 | 15% band |
| 1,000 shares | $30,000.00 | $4,500.00 | $4,500.00 | $75,500.00 | 15% band |
| Sell $40 | -$2,000.00 | $0.00 | $0.00 | $8,000.00 | $0 tax — a loss, nothing taxable |
At the defaults — shares 200, buy price $50.00, sell price $80.00, holding period long-term, filing status single, other taxable income $80,000, state tax rate 0% — the gain is $6,000.00, at 0% $0.00, at 15% $6,000.00, at 20% $0.00, the federal tax is $900.00, the NIIT is $0.00, the state tax is $0.00, the total tax is $900.00, the effective rate is 15.00%, the sale proceeds are $16,000.00, the after-tax proceeds are $15,100.00, and MAGI is $86,000.00. Check the identities: gain = shares × (sell price − buy price); at 0% = the part of the gain under the 0% threshold after other income; at 15% = the part between the 0% and 20% thresholds; at 20% = the part above the 20% threshold; federal tax = 15% × the 15% slice + 20% × the 20% slice (long-term), or the ordinary brackets (short-term); NIIT = 3.8% × the smaller of the gain and MAGI over the threshold; state tax = gain × state rate; total tax = federal tax + NIIT + state tax; effective rate = total tax ÷ gain; sale proceeds = shares × sell price; after-tax proceeds = sale proceeds − total tax. Rounding convention: totals are computed from unrounded values, so rounded parts may differ by a cent from their rounded sum.
Setup: shares 200, buy price $50.00, sell price $80.00, holding period long-term, filing status single, other taxable income $80,000, state tax rate 0%.
Line 1 — the gain. 200 × ($80.00 − $50.00) = 200 × $30.00 = $6,000.00.
Line 2 — the bands. The 0% band ends at $49,450.00 for a single filer and the $80,000.00 of other income already fills it, so $0.00 falls in the 0% band. The 15% band ends at $545,500.00, so the whole $6,000.00 falls in the 15% band, and $0.00 in the 20% band.
Line 3 — the federal tax. $6,000.00 × 15% = $900.00.
Line 4 — the NIIT. MAGI is $80,000.00 + $6,000.00 = $86,000.00, below the $200,000.00 threshold for a single filer, so the NIIT is $0.00.
Line 5 — the state tax. The state rate is 0%, so the state tax is $0.00.
Line 6 — the total. $900.00 + $0.00 + $0.00 = $900.00 total tax. Effective rate: $900.00 ÷ $6,000.00 = 15.00%. Sale proceeds: 200 × $80.00 = $16,000.00. After-tax proceeds: $16,000.00 − $900.00 = $15,100.00.
Reverse: the sell price for $1,500.00 of tax is $100.00; at $99.99 the tax is $1,499.70, at $100.01 it is $1,500.30. The shares for $3,000.00 of tax are 666.67 (exact 666.6667); at 666.67 shares the tax is $3,000.02 (unrounded $3,000.0150), at 666.66 shares it is $2,999.97. The other income for $0.00 tax is $43,450.00; at that income the tax is $0.00, at $1 more it is $0.15. The sell price for $10,000.00 of tax is $383.33 (exact 383.3333); at $383.33 the tax is $9,999.90, at $383.34 it is $10,000.20. The state rate for $1,800.00 total is 15.00%; at that rate the total tax is $1,800.00. The buy price for $0.00 tax at a $80.00 sell price is $80.00; at that buy price the tax is $0.00, at $79.99 it is $0.30.
Sell $50: gain $0.00, federal tax $0.00, total tax $0.00 — $0 tax — no gain, nothing taxable. At a $50.00 sell price the gain is $0.00, so the tax is $0.00 and you keep the whole $10,000.00 of sale proceeds — selling at your buy price is not a taxable event.
Sell $120: gain $14,000.00, federal tax $2,100.00, total tax $2,100.00 — 15% band. At $120.00 the gain is $14,000.00, all in the 15% band, so the federal tax is $2,100.00 and you keep $21,900.00 of the $24,000.00 of sale proceeds.
Sell $200: gain $30,000.00, federal tax $4,500.00, total tax $4,500.00 — 15% band. At $200.00 the gain is $30,000.00, all in the 15% band, so the federal tax is $4,500.00 and you keep $35,500.00 of the $40,000.00 of sale proceeds.
Sell $2,500: gain $490,000.00, federal tax $74,725.00, total tax $88,785.00 — 20% band reached. At $2,500.00 the gain is $490,000.00: $465,500.00 falls in the 15% band ($69,825.00) and $24,500.00 in the 20% band ($4,900.00), so the federal tax is $74,725.00, the NIIT is $14,060.00, and the total tax is $88,785.00 — you keep $411,215.00 of the $500,000.00 of sale proceeds.
Short-term: gain $6,000.00, federal tax $1,320.00, total tax $1,320.00 — 22% band (short-term). Short-term, the same $6,000.00 gain is taxed like wages: all of it falls in the 22% band, so the federal tax is $1,320.00 — $420.00 more than the $900.00 long-term tax — and you keep $14,680.00.
Short-term, other income $100,000, sell $300: gain $50,000.00, federal tax $11,886.00, total tax $11,886.00 — 22% and 24% bands (short-term). Short-term with $100,000.00 of other income and a $300.00 sell price, the gain is $50,000.00: $5,700.00 falls in the 22% band ($1,254.00) and $44,300.00 in the 24% band ($10,632.00), so the federal tax is $11,886.00 and you keep $48,114.00 of the $60,000.00 of sale proceeds.
Married filing jointly: gain $6,000.00, federal tax $0.00, total tax $0.00 — 0% band only — $0 tax. Married filing jointly, the 0% band runs to $98,900.00, so $80,000.00 of other income leaves $18,900.00 of 0% room — the whole $6,000.00 gain falls in the 0% band, the federal tax is $0.00 and you keep the full $16,000.00.
Other income $30,000: gain $6,000.00, federal tax $0.00, total tax $0.00 — 0% band only — $0 tax. With only $30,000.00 of other income, $19,450.00 of 0% room is left — more than the $6,000.00 gain — so the federal tax is $0.00 and you keep the full $16,000.00. Lower other income pulls the gain down into the 0% band.
Other income $545,500: gain $6,000.00, federal tax $1,200.00, total tax $1,428.00 — 20% band reached. With $545,500.00 of other income the gain is pushed entirely into the 20% band: the federal tax is $1,200.00, the NIIT is $228.00, and the total tax is $1,428.00 — you keep $14,572.00.
State tax 5%: gain $6,000.00, federal tax $900.00, total tax $1,200.00 — 15% band. A 5% state tax adds $300.00 on the $6,000.00 gain, so the total tax is $1,200.00 — the federal tax is unchanged at $900.00 — and you keep $14,800.00.
1,000 shares: gain $30,000.00, federal tax $4,500.00, total tax $4,500.00 — 15% band. With 1,000 shares the gain is $30,000.00, all in the 15% band, so the federal tax is $4,500.00 and you keep $75,500.00 of the $80,000.00 of sale proceeds.
Sell $40: gain -$2,000.00, federal tax $0.00, total tax $0.00 — $0 tax — a loss, nothing taxable. At a $40.00 sell price the gain is -$2,000.00 — a loss — so the tax is $0.00 and you keep the whole $8,000.00 of sale proceeds. The $2,000.00 loss is deductible against other income, up to $3,000.00 a year.
The model assumes the 2026 long-term thresholds from IRS Revenue Procedure 2025-32: the 0% band ends at $49,450.00 single and $98,900.00 married filing jointly; the 15% band ends at $545,500.00 single and $613,700.00 married filing jointly; above that the rate is 20%. It assumes the 2026 ordinary brackets for short-term gains: single 10% to $12,400.00, 12% to $50,400.00, 22% to $105,700.00, 24% to $201,775.00, 32% to $256,225.00, 35% to $640,600.00, 37% above; married filing jointly 10% to $24,800.00, 12% to $100,800.00, 22% to $211,400.00, 24% to $403,550.00, 32% to $512,450.00, 35% to $768,700.00, 37% above. It assumes the 3.8% net investment income tax applies to the smaller of the gain and MAGI over $200,000.00 single ($250,000.00 married filing jointly), where MAGI is other taxable income plus the gain. It assumes the state rate you enter applies to the whole gain, with no state exclusion. It does not model wash-sale rules, loss offsets against other gains, or the $3,000.00-a-year loss deduction limit beyond noting it. With 0 shares everything is $0.00. With a sell price of $0.00 the gain is -$10,000.00 — a loss — and the tax is $0.00; the sale proceeds are $0.00. With a buy price of $0.00 the gain is $16,000.00, all in the 15% band, so the federal tax is $2,400.00. Rounding convention: totals are computed from unrounded values, so rounded parts may differ by a cent from their rounded sum; the reverses are nearest-value solutions, and the exact unrounded figures (666.6667, 383.3333, $3,000.0150) are stated wherever the rounded figures appear.
| Output | Formula | What it means |
|---|---|---|
| Gain | shares × (sell price − buy price) | $6,000.00. |
| At 0% | the part of the gain under the 0% threshold, after other income | $0.00. |
| At 15% | the part of the gain between the 0% and 20% thresholds | $6,000.00. |
| At 20% | the part of the gain above the 20% threshold | $0.00. |
| Federal tax | 15% × the 15% slice + 20% × the 20% slice (long-term), or the ordinary brackets (short-term) | $900.00. |
| NIIT | 3.8% × the smaller of the gain and MAGI over the threshold | $0.00. |
| State tax | gain × state rate | $0.00. |
| Total tax | federal tax + NIIT + state tax | $900.00. |
| Effective rate | total tax ÷ gain | 15.00%. |
| Sale proceeds | shares × sell price | $16,000.00. |
| After-tax proceeds | sale proceeds − total tax | $15,100.00. |
| MAGI | other taxable income + gain | $86,000.00. |
| Sell price for $1,500 tax | buy price + $1,500 / (15% × shares) | $100.00 → $100.00. |
| Shares for $3,000 tax | $3,000 / (15% × gain per share) | 666.6667 → 666.67. |
| Other income for $0 tax | 0% threshold − gain | $43,450.00 → $43,450.00. |
| Sell price for $10,000 tax | buy price + $10,000 / (15% × shares) | 383.3333 → $383.33. |
| State rate for $1,800 total | ($1,800 − federal tax) / gain | 15.00% → 15.00%. |
| Buy price for $0 tax | the sell price | $80.00 → $80.00. |
| Sell $50 | same model | Gain $0.00, federal tax $0.00, total tax $0.00 — $0 tax — no gain, nothing taxable. |
| Sell $120 | same model | Gain $14,000.00, federal tax $2,100.00, total tax $2,100.00 — 15% band. |
| Sell $200 | same model | Gain $30,000.00, federal tax $4,500.00, total tax $4,500.00 — 15% band. |
| Sell $2,500 | same model | Gain $490,000.00, federal tax $74,725.00, total tax $88,785.00 — 20% band reached. |
| Short-term | same model | Gain $6,000.00, federal tax $1,320.00, total tax $1,320.00 — 22% band (short-term). |
| Short-term, other income $100,000, sell $300 | same model | Gain $50,000.00, federal tax $11,886.00, total tax $11,886.00 — 22% and 24% bands (short-term). |
| Married filing jointly | same model | Gain $6,000.00, federal tax $0.00, total tax $0.00 — 0% band only — $0 tax. |
| Other income $30,000 | same model | Gain $6,000.00, federal tax $0.00, total tax $0.00 — 0% band only — $0 tax. |
| Other income $545,500 | same model | Gain $6,000.00, federal tax $1,200.00, total tax $1,428.00 — 20% band reached. |
| State tax 5% | same model | Gain $6,000.00, federal tax $900.00, total tax $1,200.00 — 15% band. |
| 1,000 shares | same model | Gain $30,000.00, federal tax $4,500.00, total tax $4,500.00 — 15% band. |
| Sell $40 | same model | Gain -$2,000.00, federal tax $0.00, total tax $0.00 — $0 tax — a loss, nothing taxable. |
The math is exact arithmetic on your seven inputs: gain = shares × (sell price − buy price); at 0% = the part of the gain under the 0% threshold after other income; at 15% = the part between the 0% and 20% thresholds; at 20% = the part above the 20% threshold; federal tax = 15% × the 15% slice + 20% × the 20% slice (long-term), or the ordinary brackets (short-term); NIIT = 3.8% × the smaller of the gain and MAGI over the threshold; state tax = gain × state rate; total tax = federal tax + NIIT + state tax; effective rate = total tax ÷ gain; sale proceeds = shares × sell price; after-tax proceeds = sale proceeds − total tax. The 4-decimal exact is shown where the rounding matters: the shares for $3,000.00 of tax are 666.6667 (shown as 666.67); at 666.67 shares the unrounded tax is $3,000.0150, at 666.66 shares it is $2,999.97. The sell price for $10,000.00 of tax is 383.3333 (shown as $383.33). What the model cannot do is your actual tax return: wash-sale rules, loss offsets, state-specific rules and the interaction with other income types are all outside it. For the bracket detail, see the 2026 capital gains tax brackets; for the home-sale version, see the capital gains tax on home sale calculator; for the quarterly payments on the gain, see the estimated quarterly tax calculator. This is a calculator, not tax advice.
Bright Side Kit. "How Much Capital Gains Tax on Stocks? Calculator 2026" https://brightoolbox.com/capital-gains-tax-on-stocks-calculator/ Accessed October 25, 2026.On the defaults — 200 shares bought at $50.00 and sold at $80.00, long-term, single, $80,000.00 of other income — the tax is $900.00. The gain is $6,000.00 and the whole gain falls in the 15% band, because the $80,000.00 of other income already fills the 0% band. You keep $15,100.00 of the $16,000.00 of sale proceeds.
Held more than a year, the gain is long-term and taxed at 0%, 15% or 20%; held a year or less, it is short-term and taxed like wages. On the same $6,000.00 gain, the long-term tax is $900.00 and the short-term tax is $1,320.00 — $420.00 more — because the whole gain falls in the 22% ordinary band.
When your taxable income, including the gain, stays under the 0% threshold — $49,450.00 single, $98,900.00 married filing jointly. With $30,000.00 of other income, $19,450.00 of 0% room is left, so the whole $6,000.00 gain is tax-free. A married couple with $80,000.00 of income owes $0.00 on the same sale.
The net investment income tax adds 3.8% on the gain once your MAGI passes $200,000.00 single ($250,000.00 married filing jointly). MAGI is your other taxable income plus the gain. At a $2,500.00 sell price the NIIT is $14,060.00; with $545,500.00 of other income it is $228.00.
You owe no capital gains tax — there is no gain to tax. At a $40.00 sell price the gain is -$2,000.00 and the tax is $0.00. The $2,000.00 loss is deductible against other income, up to $3,000.00 a year, with the rest carried forward.
Yes, in most states — on top of the federal tax. A 5% state rate adds $300.00 on the $6,000.00 gain, so the total tax is $1,200.00. Enter your own state rate to see your total; a 15% state rate would bring the total to $1,800.00.