Capital Gains Tax Calculator

Short-term vs long-term: the tax on any sale, at your income, with NIIT included

$—
Federal Tax on the Gain
$—
Your Gain
Effective Rate on Gain
LayerAmount taxedRateTax

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.

The 2025 Long-Term Brackets (the Patience Discount)

RateSingle (taxable income incl. gains)Married joint
0%up to $48,350up to $96,700
15%to $533,400to $600,050
20%aboveabove
+3.8% NIITMAGI over $200,000over $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.

The 0% Bracket: the Most Underused Rule in the Code

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.

Basis: the Number That Decides Everything

  • Basis = what you paid, including reinvested dividends (the classic double-tax error: forgetting reinvested dividends already-taxed raises your basis).
  • Specific-lot selection: selling your highest-basis lots first (set your broker to "spec ID," not FIFO) minimizes each sale's gain — free money in taxable accounts.
  • Inherited assets get stepped-up basis to date-of-death value — decades of gains vanish untaxed; never rush to sell inherited winners for "tax reasons."
  • Gifts carry the giver's basis — gifting appreciated stock to a 0%-bracket family member (mind kiddie-tax rules) legally relocates the gain.
  • Splits adjust basis per share automatically — the Split Calculator reconstructs it.

Losses: the Other Half of the Ledger

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.

Special Cases Worth Knowing

  • Your home: $250k/$500k of gain excluded (2-of-5-year rule) — most home sales owe nothing.
  • Crypto: same capital-gains rules, every trade is a taxable event — the Crypto Tax tool handles the specifics.
  • Collectibles: 28% maximum rate. Depreciated real estate: 25% recapture on depreciation taken.
  • Qualified dividends ride the same 0/15/20 brackets — see the Dividend Tax tool.

How to Use the Calculator

  1. Enter proceeds, basis, holding period, other taxable income and status.
  2. Read the layered table — every dollar's rate, including NIIT.
  3. Before December: check your 0% room, your loss-harvest candidates, and any day-350 positions worth holding two more weeks.

Frequently Asked Questions

How is the holding period measured exactly?

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.

Do I owe tax if I don't withdraw the money from my brokerage?

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.

How does the 0% bracket interact with my wages?

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.

What is the wash-sale rule?

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).

Do states tax capital gains?

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.

Can I avoid capital gains tax entirely?

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.

Is my information private?

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.

Found this useful? Share it