Tax year 2026 figures. Last updated .
Start with the gain, not the sale price
The tax is charged on profit, not proceeds. Your gain is the amount realised on the sale, net of selling costs, less your adjusted basis.
Adjusted basis is broadly what you paid, plus capital improvements, less any depreciation you claimed. Sell for $300,000 something you bought for $100,000 and spent $25,000 improving, and the gain is $175,000 — not $300,000, and not $200,000. Improvements are the most commonly forgotten adjustment, and on a long-held property they can be the difference between a taxable gain and none.
Step 2: sort by holding period
Split every disposal into short-term (held one year or less) and long-term (held more than one year). This is not a presentational step — the two categories are netted separately and taxed on entirely different schedules.
The holding period starts the day after acquisition. One year exactly is short-term; you need one year and a day.
Step 3: net within each category, then across
Short-term losses first offset short-term gains, and long-term losses offset long-term gains. Only if one category still shows a loss does it cross over to offset the other.
This ordering is worth understanding because it is favourable and automatic: your short-term losses shelter your most expensively taxed gains before anything else.
If losses still exceed gains overall, up to $3,000 offsets ordinary income for the year ($1,500 married filing separately), and anything beyond that carries forward indefinitely — keeping its short or long character.
Step 4: subtract the deduction
Add the net gains to your other income to reach adjusted gross income, then subtract the standard deduction ($16,100 single, $32,200 joint for 2026) or your itemised total. The result is taxable income, and it is this figure — not gross income — that every capital gain threshold is measured against.
Skipping this step is the most common error in back-of-envelope calculations, and it always errs in the same direction: it puts the gain in a higher band than it actually reaches.
Step 5: stack the income in the statutory order
IRC § 1(h) sets a strict order. Ordinary income fills the lower brackets first. Then, stacked on top in sequence: unrecaptured section 1250 gain at up to 25%, then 28% collectibles gain, then the adjusted net capital gain on the 0/15/20 ladder.
The consequence is that a long-term gain can straddle two rungs, with part taxed at 15% and the remainder at 20%. There is no single rate on such a gain, and the average of the two is a number that appears nowhere on the return.
Step 6: apply the 3.8% surtax, on the lesser of two figures
If modified adjusted gross income exceeds $200,000 single or $250,000 joint, the net investment income tax applies at 3.8%. It is charged on the lesser of your net investment income and the amount by which your modified AGI exceeds the threshold.
That "lesser of" is doing real work. A taxpayer $10,000 over the threshold with a $400,000 gain pays 3.8% on $10,000, not on $400,000 — a difference of nearly $15,000. And note that modified AGI is measured before the deduction, while the capital gain ceilings are measured after it. They are different measuring sticks and conflating them is a real source of wrong answers.
Step 7: add the state
Most states tax capital gains as ordinary income on their own ladder. A few give gains a preferential rate or a partial subtraction. Eight do not tax them at all. Washington charges a separate excise tax rather than an income tax.
State taxable income is computed with its own additions and subtractions, so a state figure derived from federal taxable income is a close approximation for a straightforward wage-and-sale situation and a rougher one otherwise. The state comparison sets out what each of the covered states does.
The three places hand calculations usually go wrong
Forgetting the deduction. The ceilings are measured against taxable income, not gross. Comparing gross income to the $49,450 figure puts the gain a band too high, every time.
Treating the 3.8% surtax as a fourth rate. It applies to the lesser of net investment income and the excess over the threshold, and it is measured on modified AGI rather than taxable income. Applying it to the whole gain, or measuring it against the wrong base, is the single most common calculator bug.
Averaging a straddled gain. When part of a gain is at 15% and part at 20%, the blended percentage is not a rate that exists. It cannot be applied to anything else, and quoting it invites the reader to use it as though it were a bracket.
Doing it in the other direction
The same seven steps run backwards when the question is "how much can I realise before the rate changes". Take the ceiling for your filing status, subtract your taxable income without the gain, and the remainder is the headroom available at the current rate.
That figure is genuinely useful for splitting a disposal across two tax years, or for deciding how much to realise in a low-income year. The comparison panel under the calculator’s results computes it for whatever inputs are on screen, along with the tax at each variant, so the arithmetic is done rather than described.
A full numeric pass
Take a single filer with $150,000 of wages who sells shares for $300,000 that cost $100,000, held four years.
Gain: $300,000 less $100,000 of basis is $200,000, all long-term. Netting: no losses, so it stands at $200,000. AGI: $150,000 plus $200,000 is $350,000. Deduction: less $16,100 standard, giving taxable income of $333,900.
Split: of that, $200,000 is preferential and $133,900 is ordinary. Ordinary tax is computed on the $133,900 across the 10%, 12%, 22% and 24% brackets. Stacking: the $200,000 gain sits on top of $133,900, so it runs from $133,900 to $333,900 — entirely below the $545,500 ceiling, so all of it is taxed at 15%, giving $30,000.
Surtax: modified AGI of $350,000 exceeds the $200,000 threshold by $150,000. Net investment income is $200,000. The tax applies to the lesser, so 3.8% of $150,000 is $5,700 — not 3.8% of $200,000.
The example below runs exactly this case through the engine, so you can check each figure against the derivation rather than against this paragraph.
What to do with the answer
A computed figure is a starting point for a decision, not the end of one. Three things are usually worth doing with it.
Check whether it changes the timing. If the number is large and the asset is close to the one-year line, or the year is close to ending, the comparison panel beneath the results shows what waiting would cost or save.
Check whether it needs paying before April. A liability over $1,000 after withholding generally wants an estimated payment in the quarter the sale closed — see when capital gains tax is due.
And check it against a professional if anything unusual applies. The calculation here is the ordinary case done carefully; it is not a substitute for advice on facts it cannot see.
Rounding, and why small differences appear
Published calculators frequently disagree with each other by a dollar or two on identical inputs, and the reason is almost always rounding rather than a difference of substance.
The IRS permits rounding to whole dollars, and where in the calculation that rounding happens changes the last digit. This engine computes to the cent and rounds at the point each step is reported, which is why a derivation here may end in cents where another tool shows a whole number.
A discrepancy of a dollar is rounding. A discrepancy of hundreds is a difference in method, and worth investigating.
Worked example
Computed by the same engine that powers the calculator, at the moment this page was built — not typed in by hand. Open the derivation to see every rule and citation.
A calculation with every step visible
A single filer with $150,000 of wages sells shares for $300,000 that cost $100,000, held four years. Standard deduction.
- Taxable income after deduction
- $333,900
- Taxable gain
- $200,000
- Tax owed without the sale
- $24,734
- Tax the sale added
- $35,700
- of which net investment income tax
- $5,700
- Total federal tax
- $60,434
- Effective rate on the gain
- 17.85%
Open the derivation below and every step above appears in order, each with the code section it comes from. That is the whole point of this site: the number is only useful if you can see how it was reached.
Caveats on this example (1)
- Net investment income was derived from capital gains and qualified dividends only. Interest, non-qualified dividends, rents, royalties and passive business income inside ordinaryIncome are also net investment income under IRC 1411(c) and are not counted here.
Show the working — 13 steps, each with its citation
- Net short-term capital gain or loss for the year$0
Assets held one year or less. Taxed at ordinary rates if a net gain.
- Net long-term capital gain or loss for the year$200,000
Assets held more than one year. Eligible for the 0/15/20% rates.
- Standard deduction-$16,100
Adjusted gross income of $350,000 less $16,100.
- Taxable income$333,900
The figure the rate tables and the capital gain ceilings are both measured against.
- Ordinary income taxed at 10%$1,240
$12,400 of taxable income between $0 and $12,400.
- Ordinary income taxed at 12%$4,560
$38,000 of taxable income between $12,400 and $50,400.
- Ordinary income taxed at 22%$12,166
$55,300 of taxable income between $50,400 and $105,700.
- Ordinary income taxed at 24%$6,768
$28,200 of taxable income between $105,700 and $133,900.
- Ordinary income stacked below the long-term gain$133,900
Long-term gain is taxed by reference to where it sits ON TOP of $133,900 of other taxable income, not from the bottom of the rate table.
- Long-term gain taxed at 15%$30,000
Gain between the $49,450 zero-rate ceiling and the $545,500 15% ceiling.
- Net investment income tax threshold$200,000
Modified AGI of $350,000 against the $200,000 threshold for a single filer. This threshold is statutory and is not adjusted for inflation.
- Net investment income tax at 3.8%$5,700
3.8% of $150,000, the lesser of net investment income ($200,000) and the amount by which modified AGI exceeds the threshold ($150,000). Here the binding figure is the excess of modified AGI over the threshold.
- Total tax$60,434
$60,434 on $350,000 of total income, an effective rate of 17.27%.
Run your own figures
Nothing you enter leaves your browser. The calculation runs locally and no values are transmitted or stored on a server — see the privacy page.