Capital Gains Tax Calculator
Short-term vs long-term: the tax on any sale, at your income, with NIIT included
| Layer | Amount taxed | Rate | Tax |
|---|
Short-term vs long-term: the tax on any sale, at your income, with NIIT included
| Layer | Amount taxed | Rate | Tax |
|---|
Capital gains tax is where patience literally pays: the same $18,000 profit can owe $0, $2,700, or $6,600+ depending on how long you held and what else you earned. This calculator computes the real layered math — long-term gains stacking over ordinary income through the 0/15/20% brackets, short-term gains taxed as wages, and the 3.8% net investment income surtax that quietly tops off high earners.
| Rate | Single (taxable income incl. gains) | Married joint |
|---|---|---|
| 0% | up to $48,350 | up to $96,700 |
| 15% | to $533,400 | to $600,050 |
| 20% | above | above |
| +3.8% NIIT | MAGI over $200,000 | over $250,000 |
Short-term gains (held ≤ 1 year) get none of this — they're ordinary income at 10–37%. The single most expensive impatience in investing is selling a winner at day 360.
A married couple with $70,000 of taxable income has ~$26,700 of 0% long-term gains room this year — they can sell winners, pay nothing federally, and immediately rebuy to reset (step up) their cost basis. This "gain harvesting" is the mirror image of loss harvesting, has no wash-sale restriction (that rule only covers losses), and is standard practice in early retirement and low-income years. The calculator shows your room automatically.
Capital losses offset gains dollar-for-dollar (short against short first, long against long, then across), plus $3,000/yr against ordinary income, with unlimited carryforward. Tax-loss harvesting — selling losers, banking the loss, buying a similar-not-identical fund to stay invested — mind the wash-sale rule: repurchasing the same security within 30 days (either side) suspends the loss.
Trade date to trade date: sell one year plus one day after purchase for long-term treatment. Day 365 is still short-term — the single most expensive calendar error in investing.
Yes — the taxable event is the SALE, not the withdrawal. (Inside IRAs/401(k)s, neither sales nor gains are taxed — only distributions.) Unrealized gains owe nothing until sold.
Gains stack on top of ordinary income: with $40k of wages (single), your first ~$8k of long-term gains ride free in the 0% bracket and the rest hit 15%. The calculator's layer table shows the exact split.
A LOSS is disallowed if you buy the same (or substantially identical) security within 30 days before or after the sale. Gains have no such rule — harvest gains freely, harvest losses carefully (swap into a similar fund, not the same one).
Most tax them as ordinary income (CA up to 13.3%); a handful exempt them or have no income tax. On big sales, state choice/timing can matter as much as the federal holding period — see the State Tax Comparator.
Legally, several ways: die holding (step-up), donate appreciated shares (deduction + no gain), harvest within the 0% bracket, hold in Roth accounts, Opportunity-Zone/1031 structures for real estate, or offset with losses. 'Never sell' is a strategy, not a joke.
Yes — every figure computes locally in your browser.
Three habits capture most of the value here: never sell a winner in month eleven, check your 0% room every December, and set your broker to specific-lot ID today. The rates reward planning over reaction — which is the whole point of the design.