Key takeaways

  • Gain = proceeds − cost basis. Basis is what you paid plus commissions, reinvested dividends and improvements — getting it wrong is the single most common reason a bill comes in higher than expected.
  • Holding period sets the rate schedule. One year or less is short-term, taxed as ordinary income at 10–37%. More than a year is long-term, taxed at 0%, 15% or 20%.
  • Long-term gains stack on top of ordinary income. Your wages and pensions fill the brackets first; the gain is then layered above them and can straddle two rates.
  • A single filer pays 0% on long-term gains while total taxable income stays under $49,450 in 2026 ($98,900 married filing jointly).
  • A separate 3.8% net investment income tax applies above $200,000 of modified AGI ($250,000 joint), which is what turns "15%" into an effective 18.8%.

The four steps, in order

Every capital gains calculation is the same four steps. Work them in this order and the answer falls out:

  1. Find your gain. Sale proceeds minus your cost basis.
  2. Classify it. Held more than one year, or not?
  3. Stack it. Add the gain on top of the ordinary taxable income you already have.
  4. Apply the rate to each slice that lands in each band — then check the 3.8% surtax and your state.

Step 1: your gain is proceeds minus basis

Capital gain = what you sold it for (net of commissions) your cost basis.

Cost basis is not just the purchase price. It includes purchase commissions and fees, and — for a fund or stock held in a taxable account — every reinvested dividend, because you already paid tax on those dividends in the year they were paid. Counting them raises your basis and lowers your gain. For property, basis also picks up capital improvements (a new roof), and is reduced by depreciation you claimed.

Two basis rules worth knowing. Inherited assets get a step-up in basis to the market value on the date of death, which often erases decades of gain outright. Gifted assets do the opposite: you inherit the giver's original basis along with the asset.

Step 2: one year and a day is the line

The holding period decides which of two completely different rate schedules applies. The clock starts the day after you acquire the asset and ends on the day you sell it.

  • Short-term — held one year or less. Taxed as ordinary income at your marginal rate: 10%, 12%, 22%, 24%, 32%, 35% or 37%.
  • Long-term — held more than one year. Taxed at the preferential 0% / 15% / 20% rates.

The gap is large enough to be worth a calendar reminder. In the fourth worked example below, the same $100,000 gain costs $38,613 as a short-term gain and $18,800 as a long-term one — a $19,813 difference created by the sale date alone.

Step 3: the stacking rule

This is the mechanic that makes capital gains tax feel unpredictable. Long-term gains are not taxed in isolation and they are not simply added to your marginal bracket. Instead:

Your ordinary income fills the brackets first. The long-term gain is then stacked on top of it, and each slice of the gain is taxed at the long-term rate for the band it lands in.

So the question is never "how big is my gain" on its own — it is "where does my total taxable income sit once the gain is added". A gain can straddle two bands and be taxed partly at 0% and partly at 15%, which is exactly what happens in the second example below.

The 2026 long-term capital gains brackets

These breakpoints are measured against your total taxable income — after your standard or itemised deduction, and with the gain included. They are indexed to inflation, so they move each year.

2026 long-term capital gains rates, by total taxable income.
Filing status 0% up to 15% up to 20% above
Single $49,450 $545,500 $545,500
Married filing jointly $98,900 $613,700 $613,700
Head of household $66,200 $579,600 $579,600

The 2026 short-term (ordinary income) brackets

A short-term gain has no schedule of its own — it is dropped into the ordinary income brackets and taxed like a paycheque. These are the 2026 figures, again on taxable income.

2026 ordinary income brackets — the rates a short-term gain pays.
Rate Single, up to Married joint, up to Head of household, up to
10%$12,400$24,800$17,700
12%$50,400$100,800$67,450
22%$105,700$211,400$105,700
24%$201,775$403,550$201,775
32%$256,225$512,450$256,200
35%$640,600$768,700$640,600
37%aboveaboveabove

Four worked examples

Example 1 — the gain is genuinely tax-free

Single filer, $40,000 of taxable income, sells a fund held six years for an $8,000 long-term gain. Stacked total: $48,000, which is below the $49,450 breakpoint. The entire gain is taxed at 0% — federal tax on the gain: $0. This band is real and under-used: realising gains deliberately while you sit inside it resets your basis higher at no cost, which is the whole idea behind gain harvesting in early retirement.

Example 2 — a gain that straddles two rates

Single filer, $45,000 of taxable income, a $10,000 long-term gain. There is $4,450 of room left below the $49,450 breakpoint, so:

  • $4,450 of the gain at 0% = $0
  • The remaining $5,550 at 15% = $832.50

Total federal tax on a $10,000 gain: $832.50, an effective rate of 8.3% — neither of the two headline rates. This is the case a "what's my bracket" answer gets wrong every time.

Example 3 — the plain 15% case

Married filing jointly, $150,000 of taxable income, a $60,000 long-term gain. The stacked total of $210,000 is already past the $98,900 breakpoint and well short of $613,700, so the whole gain sits in the 15% band: $9,000. Modified AGI is under the $250,000 joint threshold, so no surtax applies. Effective rate: 15%.

Example 4 — short-term versus long-term, same gain

Single filer, $250,000 of taxable income, a $100,000 gain, modified AGI of $350,000.

  • Held 11 months (short-term). The gain stacks from $250,000 to $350,000 of ordinary income: $6,225 at 32% = $1,992, then $93,775 at 35% = $32,821.25. Add the 3.8% surtax on the full $100,000 = $3,800. Total $38,613.25 — an effective 38.6%.
  • Held 13 months (long-term). The whole gain sits in the 15% band: $15,000, plus the same $3,800 surtax. Total $18,800 — an effective 18.8%.

Two months of patience is worth $19,813.25. Our capital gains tax calculator runs both versions side by side if you want to try your own numbers.

The 3.8% net investment income tax

Above a modified-AGI threshold, investment income picks up an extra 3.8% surtax on top of whatever capital gains rate applies. The thresholds are written into law and — like the Social Security taxation thresholds — are not indexed to inflation:

  • $200,000 — single and head of household
  • $250,000 — married filing jointly
  • $125,000 — married filing separately

The surtax applies to the lesser of your net investment income and the amount by which your modified AGI exceeds the threshold — so crossing it by $5,000 costs $190, not 3.8% of the whole gain. In practice this is what turns the familiar 15% into an effective 18.8%, and 20% into 23.8%.

Losses, the $3,000 rule, and wash sales

Capital losses net against capital gains before any rate is applied — short-term against short-term first, long-term against long-term, then across. If losses exceed gains, you may deduct up to $3,000 of the excess against ordinary income in a year ($1,500 if married filing separately) and carry the rest forward indefinitely.

The trap is the wash sale rule: buy a "substantially identical" security within 30 days before or after selling at a loss, and the loss is disallowed for now — it is added to the basis of the replacement shares instead. The window is 61 days wide in total, and it spans accounts, including your IRA.

Three things that are taxed differently

  • Your home. Up to $250,000 of gain ($500,000 married filing jointly) is excluded outright if you owned and lived in it for two of the last five years. Only the excess is a taxable gain.
  • Collectibles — art, coins, physical gold, and gold ETFs structured as grantor trusts — top out at 28% rather than 20%.
  • Qualified dividends are not gains, but they use the same 0/15/20% brackets and stack the same way, so they belong in the same calculation.

State tax is on top, and rarely preferential

Everything above is federal. Most states tax capital gains as ordinary income at their normal rates, with no long-term discount — so a "15%" federal gain can be a 20%+ combined one in a high-rate state, while nine states with no income tax charge nothing. A handful offer a partial exclusion. Check your own state's treatment before assuming the federal number is the whole bill.

The knock-on effects people miss

A realised gain raises your adjusted gross income, and AGI is the input to several other calculations that have nothing to do with capital gains tax. A large sale can push more of your Social Security benefit into the taxable bands — see how Social Security is taxed — trip an IRMAA threshold that raises your Medicare premiums two years later, or phase out credits and deductions. Which is why the sequencing question — which accounts to draw down first — usually matters more than the rate on any single sale.

Frequently asked questions

How do I calculate long-term capital gains tax?

Subtract your cost basis from the sale proceeds to get the gain, confirm you held the asset more than one year, then add the gain on top of your other taxable income. Whatever slice of the gain falls below the 0% breakpoint ($49,450 single, $98,900 joint in 2026) is untaxed; the slice between that and $545,500 single ($613,700 joint) is taxed at 15%; anything above is taxed at 20%. Add the 3.8% surtax if your modified AGI is over $200,000 single or $250,000 joint.

What are the capital gains tax brackets for 2026?

For long-term gains the 2026 breakpoints on total taxable income are 0% up to $49,450, 15% up to $545,500 and 20% above that for single filers; 0% up to $98,900, 15% up to $613,700 and 20% above for married filing jointly; and 0% up to $66,200, 15% up to $579,600 and 20% above for head of household. Short-term gains use the ordinary income brackets of 10% to 37% instead.

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

A long-term gain does not push your ordinary income up — ordinary income fills the brackets first and the gain is stacked above it. But the reverse is true: your ordinary income determines which capital gains band the gain lands in, and a large gain does raise your AGI, which can affect Social Security taxation, Medicare IRMAA and various phase-outs. A short-term gain is ordinary income and does push you up.

How much capital gains tax will I pay on $10,000?

It depends entirely on your other income. A single filer with $40,000 of taxable income pays nothing on a $10,000 long-term gain, because the stacked total stays under $49,450. The same gain for someone with $150,000 of taxable income costs $1,500 at 15%. And if the asset was held a year or less, the gain is taxed at that person's ordinary rate instead — $2,200 in the 22% bracket.

Can I avoid capital gains tax legally?

Several ways, none of them exotic. Hold for more than a year to get the long-term rates. Realise gains in a year when your taxable income keeps you inside the 0% band. Offset gains with realised losses, respecting the wash sale rule. Hold assets in a Roth or traditional account, where sales are not taxable events. Donate appreciated shares to charity rather than cash. And heirs get a step-up in basis, which erases the gain entirely.

See the gain inside your whole plan

Planomy turns a single number into a whole plan: a full retirement projection with taxes and Social Security, side-by-side scenarios, and plan-vs-actual tracking as real life happens. Free, private, and running in your browser.