DevTools Logo

Capital Gains Tax Calculator

Capital Gains Tax Calculator

Estimate tax on investment sales

Runs in your browser
Try an example

Transaction

Long-term · 3 years, 6 days

Gain = sale price − purchase price − costs. Income means your other ordinary income for 2026, before the standard deduction. Future sale dates are allowed for planning.

2026 tax year · IRS Rev. Proc. 2025-32 · IRS source · runs in your browser; nothing is stored.

Estimated tax

15.00% effective on gain
Estimate only — not tax advice. Federal tax only; no state tax, loss carryovers or specialty asset rates are modeled.

Estimated federal capital gains tax

$900.00

15.00% effective on a $6,000.00 gain

Long-term · 3 years, 6 days
Gain
$6,000.00
Cost basis
$10,000.00
Net proceeds after tax
$15,100.00
Top rate band
15.00%

How the tax adds up

Rate layers applied to the gain, plus the net investment income tax
BandGain portionTax
15% long-term band$49,450.00 – $545,500.00$6,000.00$900.00
3.8% NIITMAGI below the threshold$0.00$0.00
Total$6,000.00$900.00

$460,600.00 below the 20% long-term band.

Short-term vs long-term

Short-term estimate

$1,320.00

Long-term estimate

$900.00

This sale is already long-term; treating it as short-term would add $420.00 in estimated federal tax.

2026 bracket tables (with your position)

Taxable income including this gain: $84,900.00 · standard deduction used: $16,100.00 · NIIT threshold: $200,000.00

2026 long-term capital gains brackets
BandRange
0% long-termTaxable income up to $49,450.00
15% long-term ← you$49,450.00 – $545,500.00
20% long-termOver $545,500.00
2026 ordinary income brackets
BandRange
10% ordinary$0.00 – $12,400.00
12% ordinary$12,400.00 – $50,400.00
22% ordinary ← you$50,400.00 – $105,700.00
24% ordinary$105,700.00 – $201,775.00
32% ordinary$201,775.00 – $256,225.00
35% ordinary$256,225.00 – $640,600.00
37% ordinaryOver $640,600.00

Not tax advice. Federal estimate using 2026 tax year · IRS Rev. Proc. 2025-32, a simplified stacking method and the standard deduction. State taxes, other deductions, AMT, loss carryovers, wash sales and collectibles/real-estate specialty rates are excluded. Verify against your return or a tax professional.

  • Federal estimate only. Not tax advice; no state tax, AMT, loss carryovers, wash-sale rules, collectibles (28%) or unrecaptured §1250 (25%) rates are modeled.
  • 2026 brackets from IRS Rev. Proc. 2025-32. Other income is reduced by the $16,100.00 standard deduction before bracket placement; other deductions are not modeled.
  • Short-term gains use layered ordinary brackets; long-term gains use layered 0%/15%/20% bands. NIIT is 3.8% of the lesser of the gain and MAGI above the filing-status threshold.

Examples

Long-term stock sale

Buy $10,000 in 2023 and sell for $16,000 in 2026 with $95,000 of other income: a $6,000 long-term gain falls wholly in the 15% band, so the estimate is $900 with no NIIT.

Short-term crypto sale

A crypto position held ten months is taxed at ordinary rates. The calculator layers the gain over the 12% and 22% brackets instead of applying a flat marginal rate, and shows how much waiting for long-term treatment would save.

High income and NIIT

For a joint filer with $600,000 of income, a $50,000 gain lands in the 20% band and the 3.8% NIIT applies to the lesser of the gain and MAGI above $250,000.

About this tool

Enter a purchase price and date, a sale price and date, selling costs, your other income and filing status to estimate federal capital gains tax. Gain is sale price minus purchase price and costs; the IRS one-year anniversary rule decides short- versus long-term. Long-term gains are layered across the 2026 0%/15%/20% bands and checked for the 3.8% net investment income tax; short-term gains are layered across ordinary income brackets. Results show the gain, holding period, rate bands, tax owed, effective rate, net proceeds and a side-by-side short-versus-long comparison with a countdown to long-term treatment. Bracket tables are dated to IRS Rev. Proc. 2025-32. Everything runs in your browser — no inputs are saved or uploaded. Estimates only, not tax advice.

What this tool does not do

  • Figures are simplified planning estimates, not tax, payroll, accounting, or investment advice; verify rates and rules for your jurisdiction.
  • Runs entirely in the current browser tab; nothing is synced across devices or backed up to a server.

How to use this tool

  1. Enter cost basis, sale price, and dates

    Input purchase/sale amounts, selling fees, and dates to determine holding period.

  2. Set filing status and other income

    Provide filing status and ordinary income so bracket stacking and NIIT are accurate.

  3. Compare short vs long term

    Review estimated federal tax, effective rate, net proceeds, and long-term savings.

Use cases

Long-term stock sale

Buy $10,000 in 2023 and sell for $16,000 in 2026 with $95,000 of other income: a $6,000 long-term gain falls wholly in the 15% band, so the estimate is $900 with no NIIT.

Short-term crypto sale

A crypto position held ten months is taxed at ordinary rates. The calculator layers the gain over the 12% and 22% brackets instead of applying a flat marginal rate, and shows how much waiting for long-term treatment would save.

High income and NIIT

For a joint filer with $600,000 of income, a $50,000 gain lands in the 20% band and the 3.8% NIIT applies to the lesser of the gain and MAGI above $250,000.

Common mistakes

Mistake:How are long-term gains stacked on top of ordinary income?

Fix:Taxable ordinary income fills the bottom of the bracket ladder first, and your long-term gain sits on top—meaning a single sale can straddle the 0% and 15% (or 15% and 20%) bands rather than being taxed at one flat rate.

Mistake:When does the 3.8% Net Investment Income Tax (NIIT) apply?

Fix:NIIT applies to the lesser of net investment income or the amount by which modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly).

Frequently asked questions

What qualifies for long-term capital gains rates?

Under IRS rules, an asset must be held for more than one full year (at least one year plus one day from acquisition to sale) to qualify for preferential 0%, 15%, or 20% long-term brackets rather than ordinary income rates.

How are long-term gains stacked on top of ordinary income?

Taxable ordinary income fills the bottom of the bracket ladder first, and your long-term gain sits on top—meaning a single sale can straddle the 0% and 15% (or 15% and 20%) bands rather than being taxed at one flat rate.

When does the 3.8% Net Investment Income Tax (NIIT) apply?

NIIT applies to the lesser of net investment income or the amount by which modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly).

Does this replace tax filing software or CPA advice?

No. It models US federal brackets only (excluding state taxes, wash sales, depreciation recapture, and collectibles rates) strictly for planning estimates, not tax advice.