📈 Capital Gains Tax Calculator (Federal, and )

Estimate your U.S. federal capital gains tax easily. Input your sale proceeds, cost basis, and income to calculate short-term and long-term liabilities.

Last updated: 18 October 2026

Capital Gains Tax Calculator (Federal, 2026 and 2025)

Tax years 2025 and 2026 · Federal only · USD · Thresholds are editable defaults; confirm current figures with the IRS before relying on the result.

This capital gains tax calculator (also used as a capital gains calculator for stocks and funds) estimates U.S. federal tax when you sell a capital asset. It nets short-term and long-term gains and losses, applies ordinary rates to short-term gains, and applies the 0%, 15% and 20% bands to long-term gains stacked on top of your taxable income. State and local capital gains taxes are not included.

Estimate with limitations. Every regulated rate and threshold is an editable input with a default value. Treat results as a planning estimate, not a tax filing figure.

Federal capital gains tax calculator

Enter your figures below. Amounts are U.S. dollars. Dates decide whether the sale is short-term (held one year or less) or long-term (held more than one year).

Tax year and filing status

Only 2025 and 2026 have threshold records.

Single and married filing jointly only.

Sale details

Cost basis is generally what you paid for the asset, adjusted for certain events. Verify your basis on IRS Form 8949 and Publication 550.

Taxable income before capital gains (after deductions you expect to claim). Long-term gains stack on top of this amount.

Other gains, losses, and carryover
Optional net investment income tax (NIIT)

NIIT applies to the lesser of net investment income or modified adjusted gross income above the statutory threshold. The threshold is not inflation-indexed. Confirm on Form 8960 instructions.

Investment income and gains before adding the sale modeled here. NIIT on this sale is estimated as 3.8% of the gain portion of net investment income that exceeds the MAGI threshold.

Editable capital gains tax rates and ordinary brackets (editable defaults — adjust if you have current official figures)

They are editable defaults. Replace them with figures from Rev. Proc. 2025-32 (tax year 2026) and the prior-year procedure (tax year 2025) before relying on any result.

Long-term capital gains rates — thresholds by filing status

These long term capital gains rates use the 0%, 15%, and 20% brackets (capital gains tax brackets by taxable income). Values below are editable defaults, not official figures.

Capital gains tax rates bands (editable)
Tax year Filing status 0% up to (USD taxable income) 15% up to (USD taxable income) 20% above
2026 Single 20%
2026 Married filing jointly 20%
2025 Single 20%
2025 Married filing jointly 20%

Ordinary income tax brackets used for short-term gains (editable)

Federal income tax brackets (editable defaults — confirm before use)
Year Status Bracket upper bounds (USD taxable income), rates 10/12/22/24/32/35/37

Your estimate

Enter your figures and select Calculate to see an estimate.

How to use this long term capital gains tax calculator and short term capital gains tax calculator

  1. Choose the tax year in which the sale is reported and your filing status. Only single and married filing jointly are supported.
  2. Enter sale proceeds, selling costs (commissions, fees), and your adjusted cost basis. The calculator computes gain = proceeds − selling costs − basis.
  3. Enter acquisition and sale dates. Holding period is counted from the day after acquisition through the sale day. More than one year is long-term; one year or less is short-term.
  4. Add any other short-term or long-term gains or losses and capital loss carryovers from prior years.
  5. Optionally enable NIIT and enter modified adjusted gross income plus any other net investment income.
  6. Review the editable rate tables if you have current official thresholds from the IRS Revenue Procedure for your year.
  7. Select Calculate. Then use “What if I wait until long-term?” to compare selling on the first day the holding period becomes long-term.

How to calculate capital gains tax — method

The engine follows the ordinary U.S. federal sequence described in IRS Topic No. 409, Publication 550, the Schedule D instructions, the Qualified Dividends and Capital Gain Tax Worksheet in the Form 1040 instructions, and Form 8960 for NIIT. Those pages are official starting points you should open yourself; they were not retrieved.

  1. Gain or loss on the sale: gain = proceeds − selling costs − adjusted basis.
  2. Holding period: more than one year = long-term; otherwise short-term.
  3. Net within each term: combine this sale with other short-term and long-term amounts and prior-year carryovers.
  4. Net across terms: if one term is a net loss and the other a net gain, apply the loss against the gain (short-term losses against short-term gains first, then remaining losses against long-term gains, and the reverse order when long-term is the net loss), following the Schedule D instructions.
  5. Short-term gain is ordinary income and uses the ordinary federal rate schedule for your filing status and year.
  6. Long-term gain is stacked on top of ordinary taxable income (which includes any net short-term gain). The portion at or below the 0% ceiling is taxed at 0%, the portion up to the 15% ceiling at 15%, and the remainder at 20%.
  7. NIIT (optional): 3.8% × the lesser of net investment income (including the gain) and MAGI above the threshold for your filing status.
  8. Net capital loss deduction: if capital losses exceed capital gains, the excess deductible against ordinary income is limited each year (editable input, default $3,000). Further excess carries forward.

Rounding: internal math uses decimal cents (half-up). Displayed amounts are rounded to the nearest cent. The official Qualified Dividends and Capital Gain Tax Worksheet may round differently on a filed return.

Worked examples (hypothetical inputs)

These labeled hypothetical examples show every arithmetic step. They test the calculator engine, not any individual’s tax return. Thresholds used are the editable defaults.

Example F1 — single filer, long-term gain, 0% band partially used

Inputs (hypothetical): tax year 2026; single; ordinary taxable income before the gain $40,000; long-term gain $20,000; no losses; NIIT off.

  1. Ordinary tax on $40,000: 10% × $12,400 = $1,240.00; 12% × $27,600 = $3,312.00; total ordinary = $4,552.00.
  2. 0% band left = $49,450 − $40,000 = $9,450.
  3. 15% applies to $20,000 − $9,450 = $10,550 → $1,582.50.
  4. Capital gain tax = $1,582.50. Total tax on the stack = $4,552.00 + $1,582.50 = $6,134.50.

Example F2 — single filer, large income, 15% and 20% bands

Inputs (hypothetical): tax year 2026; single; ordinary taxable income $500,000; long-term gain $100,000.

  1. 15% band left = $545,500 − $500,000 = $45,500 → 15% × $45,500 = $6,825.00.
  2. 20% on the remaining $54,500 → $10,900.00.
  3. Long-term gain tax = $17,725.00. Ordinary tax on $500,000 under the editable single schedule defaults to $143,769.25 (editable bracket defaults).

Example F3 — NIIT

Inputs (hypothetical): single; MAGI $260,000; net investment income $70,000 (including the modeled gain); threshold $200,000; rate 3.8%.

  1. Lesser of NII $70,000 and MAGI − threshold = $60,000.
  2. NIIT = 3.8% × $60,000 = $2,280.00.

Examples F4–F6 — holding period, gain math, loss netting

  • F4: acquired 2025-01-15; sale 2026-01-15 is short-term (exactly one year); sale 2026-01-16 is long-term.
  • F5: proceeds $12,500.00 − selling costs $25.00 − basis $9,000.00 = gain $3,475.00.
  • F6: short-term gain $5,000 and long-term loss $8,000 → net loss $3,000 before applying the annual deduction limit (limit is an editable input).

Short term vs long term capital gains

Comparison table #1 — how holding period changes the federal treatment
FeatureShort-term (held ≤ 1 year)Long-term (held > 1 year)
Rate systemOrdinary income tax brackets (10%–37%)Preferential 0%, 15%, 20% bands
StackingPart of ordinary taxable incomeStacked on top of ordinary taxable income
Typical effect at moderate incomeCan be taxed at 22%–24% or higherOften 0% or 15% if income is low enough
Loss interactionNetted with other short-term items firstNetted with other long-term items first
Waiting strategySell nowWait until the day after the one-year anniversary of purchase
Comparison table #2 — effect of other income on the long-term rate band (hypothetical, TY2026 single defaults)
Ordinary taxable income before gain0% band remainingLikely first long-term rate on new gain
$0$49,450 (editable default)0% until the band fills
$40,000$9,4500% then 15%
$50,000$0 (past the 0% ceiling)15%
$500,000$015% then 20% above $545,500

Infographics — how the tax is built

Infographic 1 — steps from sale to federal tax on the gain
1. Sale proceeds100%
2. Minus selling costs and cost basis → net gain or lossGain
3. Classify holding period (short-term or long-term)Dates
4. Net with other gains, losses, and carryoversNet
5. Apply ordinary rates and long-term bands, plus optional NIITTax
Five steps flow left to right from the sale event to the estimated federal tax figure.

✓ What this calculator does

  • Federal capital gains tax estimate for ordinary capital assets
  • Short-term vs long-term classification from dates
  • Loss netting, deduction limit, and carryover view
  • Optional NIIT with editable threshold
  • Editable year thresholds

✗ What it does not do

  • State or local capital gains tax
  • Collectibles, section 1250, or section 1202 special rates
  • Wash sales, installment sales, or inherited basis rules
  • Crypto-specific or foreign asset treatment
  • Home-sale exclusion under section 121

Common mistakes and key conditions

  • Counting the purchase day as day one. The holding period starts the day after acquisition. Selling on the one-year anniversary is still short-term.
  • Ignoring selling costs. Commissions and fees reduce gain (or increase loss) and belong in the basis calculation.
  • Using the wrong income base. Long-term rates depend on where total taxable income (including the gain) falls relative to the year’s thresholds, not on the gain size alone.
  • Forgetting loss carryovers. Prior-year capital losses that were not fully used can still offset this year’s gains.
  • Assuming the $3,000 loss deduction is unlimited. Only a limited amount of net capital loss can offset ordinary income each year; the rest carries forward.
  • Skipping NIIT. Higher-income taxpayers may owe an extra 3.8% on investment income, including capital gains.
  • Expecting state tax to be zero. Many states tax capital gains as ordinary income. This tool is federal only.

FAQ — capital gains tax on stocks and other assets

What is a capital gains tax calculator and what does this one estimate?

A capital gains tax calculator estimates the tax you may owe when you sell an asset such as stocks, funds, or other capital property. This tool estimates U.S. federal tax only by netting short-term and long-term gains and losses, applying ordinary rates to short-term gains and the 0%, 15%, and 20% long-term bands stacked on taxable income, plus optional NIIT. State and local taxes are not included. IRS Topic No. 409 and Publication 550 describe the federal framework.

How is capital gains tax on stocks different from tax on wages?

Short-term capital gains from stocks held one year or less are taxed like ordinary income, in the same brackets as wages. Long-term gains from stocks held more than one year use the preferential 0%, 15%, and 20% capital gains tax rates, which depend on total taxable income for the year. See IRS Topic No. 409 and the Qualified Dividends and Capital Gain Tax Worksheet in the Form 1040 instructions.

How long to hold for long term capital gains?

You must hold the asset for more than one year. The holding period is counted from the day after the acquisition date through the sale date. If you buy on January 15, 2025, a sale on January 15, 2026 is still short-term; a sale on January 16, 2026 is long-term. Confirm with IRS Publication 550.

What is cost basis and why does it matter?

Cost basis is generally the amount you paid to acquire the asset, adjusted for certain events such as return of capital, reinvested dividends, or improvements. Gain equals proceeds minus selling costs minus adjusted basis. Higher basis means a smaller taxable gain. Report basis and holding period on IRS Form 8949 and Schedule D.

How does a capital loss carryover work?

If your capital losses exceed your capital gains for the year, you may deduct part of the net loss against ordinary income up to an annual limit (an editable input in this tool; the common statutory figure is $3,000). Any remaining loss carries forward to later years under the rules in the Schedule D instructions and Publication 550.

Can I deduct capital losses against my gains and still owe tax?

Losses first offset gains of the same type, then the other type. You owe tax only on a net gain after those steps. If losses still exceed gains, the limited deduction against ordinary income and any carryover reduce (but may not eliminate) the tax impact. Limits are editable here.

What is the net investment income tax on capital gains?

Form 8960 imposes a 3.8% net investment income tax on the lesser of net investment income or modified adjusted gross income above a statutory threshold (commonly cited as $200,000 single and $250,000 married filing jointly; not inflation-indexed). Those threshold figures are editable defaults in this tool.

Does this calculator include capital gains tax on a home sale?

No. The home-sale exclusion under section 121 is outside this calculator’s scope. Gains above the exclusion limits, ownership and use tests, and special depreciation recapture rules must be evaluated separately.

Are there separate long-term capital gains rates for each tax year?

Yes. The 0% and 15% ceilings are indexed each year and set in the annual Revenue Procedure (for example, Rev. Proc. 2025-32 for tax year 2026). This calculator stores separate editable records for 2025 and 2026. Always match the sale to the tax year you report it.

Glossary

Cost basis
Your acquisition cost with certain adjustments; subtracted from proceeds to find gain or loss.
Adjusted basis
Cost basis after events such as return of capital, stock splits, or improvements.
Short-term capital gain or loss
Result of selling a capital asset held one year or less. Taxed as ordinary income when a gain.
Long-term capital gain or loss
Result of selling a capital asset held more than one year. Eligible for the 0%, 15%, and 20% capital gains tax rates.
Capital loss carryover
Unused capital loss from a prior year that can offset future gains and, within limits, ordinary income.
Net investment income tax (NIIT)
Additional 3.8% federal tax on investment income for taxpayers above MAGI thresholds; reported on Form 8960.
Stacking
Placing long-term capital gain on top of ordinary taxable income so the gain fills the preferential rate bands from the bottom up.
Wash sale
Replacement of a security sold at a loss within a short window; loss may be disallowed under IRS rules. Out of scope here.

Official references (starting points — open them yourself)

The links below are the official starting points named in the product brief. Confirm every rate, threshold, and procedure on those pages before filing or advising.

Last rules update intended for this package: 2026-10-18.

Limitations, exclusions, and assumptions

  • Federal only. State and local capital gains taxes are not included.
  • Ordinary capital assets only. Collectibles (28%), unrecaptured section 1250 gain (25%), section 1202 stock, wash sales, installment sales, inherited or gifted basis, and cryptocurrency-specific rules are outside calculator scope.
  • AMT, phase-outs, credits, and estate or trust rates are not modeled.
  • Every rate, ceiling, ordinary bracket edge, NIIT threshold, and loss-deduction limit is an editable input.
  • Estimate only. This is not tax, legal, or investment advice. Corrections can be reported through the site’s normal contact channel on varnda.com; no dedicated review email is published in this package.
  • Byline: Varnda Editorial Team. Calculations run in your browser; no personal identifiers are collected by this page.

Bottom line

Use this federal capital gains tax calculator to see how holding period, income level, losses, and optional NIIT change the U.S. federal tax on a sale. Not a substitute for official instructions or professional advice.

Capital Gains Tax Calculator (Federal, and )
Share this calculator with someone who needs it
WhatsApp Facebook X LinkedIn Pinterest YouTube