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).
Your estimate
Enter your figures and select Calculate to see an estimate.
Holding period classification
Net short-term and net long-term result
Netting of short-term and long-term amounts (Schedule D method)
Component
Amount (USD)
Rule
Tax on the gain — stacking breakdown
Estimated federal tax on the capital gain by rate band
Layer
Base (USD)
Rate
Tax (USD)
Note
Stacking chart — where the gain falls
Long-term gain stacked on ordinary taxable income
Stacking chart data table
Zone
Taxable income level (USD)
Rate
What if I wait? Short-term vs long-term comparison
Short term vs long term capital gains — same engine, later sale date
Measure
Sale as entered
Sale on first long-term day
Difference
Loss netting, deduction limit, and carryover
Capital loss deduction limit and carryover (limit is an editable input)
Item
Amount (USD)
Note
Method and sources used for this run
What this result includes and excludes
Includes: U.S. federal tax on an ordinary capital asset; short-term and long-term netting; optional NIIT estimate; editable rate thresholds.
Excludes: state and local tax; collectibles (28%); unrecaptured section 1250 gain (25%); section 1202 qualified small business stock; wash sales; installment sales; inherited or gifted basis; cryptocurrency-specific rules; AMT; phase-outs; estate and trust rates; home-sale exclusion under section 121.
Not supported yet: head of household and married filing separately threshold sets; any tax year other than 2025 and 2026.
How to use this long term capital gains tax calculator and short term capital gains tax calculator
Choose the tax year in which the sale is reported and your filing status. Only single and married filing jointly are supported.
Enter sale proceeds, selling costs (commissions, fees), and your adjusted cost basis. The calculator computes gain = proceeds − selling costs − basis.
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.
Add any other short-term or long-term gains or losses and capital loss carryovers from prior years.
Optionally enable NIIT and enter modified adjusted gross income plus any other net investment income.
Review the editable rate tables if you have current official thresholds from the IRS Revenue Procedure for your year.
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.
Gain or loss on the sale: gain = proceeds − selling costs − adjusted basis.
Holding period: more than one year = long-term; otherwise short-term.
Net within each term: combine this sale with other short-term and long-term amounts and prior-year carryovers.
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.
Short-term gain is ordinary income and uses the ordinary federal rate schedule for your filing status and year.
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%.
NIIT (optional): 3.8% × the lesser of net investment income (including the gain) and MAGI above the threshold for your filing status.
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.
Ordinary tax on $40,000: 10% × $12,400 = $1,240.00; 12% × $27,600 = $3,312.00; total ordinary = $4,552.00.
0% band left = $49,450 − $40,000 = $9,450.
15% applies to $20,000 − $9,450 = $10,550 → $1,582.50.
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.
15% band left = $545,500 − $500,000 = $45,500 → 15% × $45,500 = $6,825.00.
20% on the remaining $54,500 → $10,900.00.
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%.
Lesser of NII $70,000 and MAGI − threshold = $60,000.
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.
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
Feature
Short-term (held ≤ 1 year)
Long-term (held > 1 year)
Rate system
Ordinary income tax brackets (10%–37%)
Preferential 0%, 15%, 20% bands
Stacking
Part of ordinary taxable income
Stacked on top of ordinary taxable income
Typical effect at moderate income
Can be taxed at 22%–24% or higher
Often 0% or 15% if income is low enough
Loss interaction
Netted with other short-term items first
Netted with other long-term items first
Waiting strategy
Sell now
Wait 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 gain
0% band remaining
Likely first long-term rate on new gain
$0
$49,450 (editable default)
0% until the band fills
$40,000
$9,450
0% then 15%
$50,000
$0 (past the 0% ceiling)
15%
$500,000
$0
15% then 20% above $545,500
Infographics — how the tax is built
Infographic 1 — steps from sale to federal tax on the gain
1. Sale proceeds
100%
2. Minus selling costs and cost basis → net gain or loss
Gain
3. Classify holding period (short-term or long-term)
Dates
4. Net with other gains, losses, and carryovers
Net
5. Apply ordinary rates and long-term bands, plus optional NIIT
Tax
✓ 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.
Related calculators
For broader planning, you may also want a paycheck estimate for take-home pay, a credit-card payoff timeline, personal-loan monthly payment math, or a full mortgage payment estimate with taxes, insurance, and PMI:
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.