Capital gains tax calculator
How a sale is taxed turns on one date. The default — a $25,000 sale of a $10,000 holding, single with $80,000 of other income — is a $15,000 long-term gain taxed $2,250, against $3,300 if it were short-term: $1,050 saved for holding past a year. Every figure is computed below, using 2026 federal rules.
Worksheet
- Capital gain
- $15,000
- Tax on the gain
- $2,250
- After-tax proceeds
- $22,750
- Effective rate on the gain
- 15.0%
- If held short-term (1 year or less)
- $3,300
How the formula works
A capital gain is the simplest arithmetic on this page — what you sold it for minus what you paid, the cost basis:
What is not simple is the rate, and it turns on one thing: how long you held the asset. One year or less and the gain is short-term — taxed exactly like a paycheck, at your ordinary-income rates. More than a year and it is long-term, taxed through a separate, gentler schedule of 0%, 15% and 20%.
Either way the gain is stacked on top of the income you already have. For a long-term gain, your ordinary taxable income \(I\) fixes the starting height, and the gain fills the range \([I,\, I + \text{gain}]\); each long-term bracket taxes the part of that range that falls inside it. With bracket boundaries \(b_1 < b_2 < \dots\) and rates \(r_1, r_2, \dots\):
That is why a single gain can be taxed at two rates at once: if your income sits below the 15% threshold but the gain carries you across it, the dollars below the line are taxed at 0% and the dollars above at 15% — the bracket splits the gain. A short-term gain uses the very same stacking, only against the ordinary brackets, which run from 10% all the way to 37%.
On top of either sits the 3.8% Net Investment Income Tax, which reaches the gain once your modified income passes $200,000 (single) or $250,000 (married filing jointly) — it applies to the lesser of the gain and the amount you are over the threshold.
Why the one-year line is the whole game. The same gain, the same seller, one day's difference in the holding period: a short-term gain is taxed as ordinary income, often at 22% or 24%, while the long-term rate on it is frequently 15% — close to half. Nothing else on this page moves the number as much as crossing the one-year mark, which is why the worksheet always shows you the other term's tax beside your own.
The figures here are for tax year 2026 and change annually. The long-term brackets start the 15% rate at $49,450 of taxable income (single) / $98,900 (married filing jointly) and the 20% rate at $545,500 / $613,700; below the first line the long-term rate is 0%. Short-term gains use the seven ordinary brackets, 10% to 37%. The Net Investment Income Tax threshold is $200,000 single / $250,000 jointly.
What each input means
- Purchase price / cost basis
- What you paid for the asset, including commissions and fees — the number you are taxed above. For reinvested dividends or shares bought over time, the basis is the total you actually put in; getting it right is the whole job, because every dollar of overstated basis is a dollar of gain you would otherwise be taxed on.
- Sale price
- What you received when you sold, net of selling costs. Sale minus basis is the gain; if it comes out negative, you have a capital loss, and the worksheet switches to showing how much of it you can deduct.
- Holding period
- More than one year is long-term; one year or less is short-term. The clock starts the day after you bought and includes the day you sold. This single choice usually moves the tax more than any other input — hold the default gain one more day past a year and the rate can drop from ordinary to long-term.
- Filing status
- Single or married filing jointly. The married long-term thresholds and the NIIT threshold are higher, so the same gain on the same income is often taxed more gently. Head of household and married-filing-separately sit elsewhere and are not modeled here.
- Taxable income excluding this gain
- Your other taxable income for the year, after deductions and before this sale — wages, interest, other gains. It sets the height the gain stacks on, which decides both the ordinary bracket a short-term gain lands in and the long-term rate (0/15/20%) that applies. Enter income already net of the standard or itemized deduction; this tool does not subtract one for you.
A worked example
The worksheet's defaults: a $10,000 cost basis, a $25,000 sale, held more than a year, single, with $80,000 of other taxable income.
- Capital gain: $25,000 − $10,000 = $15,000.
- Long-term (the default): the gain stacks on the $80,000 of income, filling $80,000 to $95,000. All of it falls inside the 15% long-term bracket (the gain stacks from $80,000 to $95,000, both above the $49,450 line and below the $545,500 one), so the whole gain is taxed at 15%. $15,000 × 15% = $2,250. Modified income stays under $200,000, so there is no Net Investment Income Tax. Total: $2,250, an effective 15.0% on the gain.
- Short-term, for contrast: the same gain taxed as ordinary income fills the same slice, which sits in the 22% bracket — $15,000 × 22% = $3,300.
- The one-year reward: holding past a year turns a $3,300 bill into a $2,250 one — $1,050 saved on the very same gain.
- After-tax proceeds on the long-term sale: $25,000 − $2,250 tax = $22,750.
Assumptions and limits
- Federal tax only, for tax year 2026 — the brackets and thresholds are adjusted annually, so results drift out of date unless the constants are updated. Many states tax capital gains too, usually as ordinary income; a few have no income tax at all. This page adds nothing for state tax.
- It taxes the gain in isolation. In reality the gain can push other income around, interact with credits and phase-outs, the Alternative Minimum Tax, or the taxation of Social Security — none of which is modeled. Enter your income already net of deductions; the tool does not apply one.
- The 3.8% Net Investment Income Tax is approximated. Its threshold applies to modified adjusted gross income, which is before deductions, so the tool adds the $16,100 / $32,200 standard deduction back to your taxable income to estimate it. If you itemize, your MAGI is higher still. The tax is charged on the lesser of this gain and the amount MAGI tops the threshold, ignoring other investment income.
- The gain is assumed to be on a security (a stock, fund or bond). Collectibles are taxed at up to 28%, and the part of a real-estate gain from depreciation is recaptured at up to 25% — both higher than the rates here.
- A loss is deductible against ordinary income only up to $3,000 a year; the rest carries forward to future years. This tool shows the cap and the carryforward but does not track prior-year carryovers.
- This is arithmetic, not advice. It shows what the inputs imply under one year's rules; it cannot see your whole tax situation.
Questions people ask
What is the difference between short-term and long-term capital gains?
Only the calendar — and it is worth a lot. Hold an asset one year or less and the gain is short-term, taxed as ordinary income at rates up to 37%. Hold it more than a year and it is long-term, taxed at 0%, 15% or 20%. On the default $15,000 gain the difference is $3,300 short-term versus $2,250 long-term — $1,050 saved for holding one extra day past the year. The clock starts the day after you buy and includes the day you sell.
Is the 0% long-term capital gains rate real?
Yes, and it is not a loophole. If your taxable income (the gain included) stays under $49,450 single or $98,900 married filing jointly, the long-term rate on the part below that line is genuinely zero. Run the default gain as a married couple with $60,000 of other income and the long-term tax is $0 — the whole gain lands under the $98,900 threshold. It is why low-income years, early retirement and gap years are prime times to realize gains on purpose.
What is the Net Investment Income Tax?
An extra 3.8% surtax on investment income — capital gains, dividends, interest, rents — for higher earners. It kicks in once your modified adjusted gross income passes $200,000 single or $250,000 jointly, and applies to the lesser of your investment income and the amount you are over the threshold. A $250,000 long-term gain on $100,000 of other income, single, owes $6,312 of NIIT on top of the regular capital-gains tax. This page approximates it and ignores other investment income you might have.
Can I offset gains with losses?
Yes — this is tax-loss harvesting. Capital losses first cancel capital gains dollar for dollar (long against long, short against short, then across). If losses exceed gains, up to $3,000 of the excess can be deducted against ordinary income each year, and anything beyond that carries forward indefinitely to future years. Watch the wash-sale rule: buy back the same or a substantially identical security within 30 days and the loss is disallowed for now.
Do I owe state tax on capital gains too?
Usually. Most states tax capital gains as ordinary income, with no preferential long-term rate — so a gain that enjoys the 15% federal rate can still face your full state rate on top. A handful of states levy no income tax at all, and a few treat gains specially. This calculator is federal only; add your state's rate separately for the full bill.