Capital Gains Tax Calculator
Estimate U.S. capital gains tax from proceeds, basis, losses, filing status, and gain treatment, with NIIT, tax-layer, and scenario checks.- {{ warning }}
| Metric | Value | Basis | Copy |
|---|---|---|---|
| {{ row.metric }} | {{ row.value }} | {{ row.basis }} |
| Layer | Gain amount | Rate | Tax | Rule | Copy |
|---|---|---|---|---|---|
| {{ row.layer }} | {{ row.amount }} | {{ row.rate }} | {{ row.tax }} | {{ row.rule }} |
| Priority | Signal | Action | Basis | Copy |
|---|---|---|---|---|
| {{ row.priority }} | {{ row.signal }} | {{ row.action }} | {{ row.basis }} |
| Scenario | Sale proceeds | Taxable gain | Total tax | After-tax gain | Copy |
|---|---|---|---|---|---|
| {{ row.scenario }} | {{ row.sale }} | {{ row.taxableGain }} | {{ row.totalTax }} | {{ row.afterTaxGain }} |
{{ jsonOutput }}
Introduction
Capital gains tax planning starts with the sale, the basis you can support, the type of gain, and the rest of your taxable income for the year. A stock sale, crypto disposition, collectible sale, rental-property component, or main-home sale can produce the same raw gain but land in different federal tax rules.
This calculator estimates a U.S. federal capital gains tax result for 2025 or 2026. It models sale proceeds, cost basis, basis additions, selling costs, capital loss offsets, selected exclusions, filing status, other taxable income, modified adjusted gross income (MAGI), optional Net Investment Income Tax (NIIT), and an optional flat state or local planning rate.
Use the estimate to size a planned sale, compare short-term and long-term treatment, test loss offsets, or decide whether a tax professional should review the transaction before the sale closes. The result is a planning estimate, not a filed return calculation.
How to Use This Tool:
- Choose the federal tax year, filing status, and gain treatment. The treatment controls whether the estimate uses standard long-term bands, ordinary income brackets, a special maximum rate, a home-sale exclusion path, or a custom flat federal rate.
- Enter sale proceeds, cost basis, basis additions, and selling costs. Use sale and basis records that match the asset lot or property component you are estimating.
- Add other taxable income before the gain. Long-term capital gain bands stack on top of this amount, so entering gross wages instead of taxable income can overstate the bracket position.
- Enter MAGI before the gain if NIIT is turned on. MAGI can differ from taxable income, especially when deductions, exclusions, or other income adjustments apply.
- Add capital loss offsets, a main-home exclusion amount when eligible, or another verified exclusion only when you have records or advice that support it.
- Leave the state or local rate at 0 for a federal-only estimate, or enter a verified combined rate for planning. The calculator applies that percentage as a flat rate to taxable gain.
- Review the summary first, then use the Gain Snapshot, Tax Layer Ledger, Planning Review, Federal Gain Layer Chart, Sale Tax Curve, Sale Scenario Table, and JSON tabs to audit the result.
The Advanced controls are for presentation and sensitivity. Scenario sale swing changes the sale prices tested in the curve and scenario table. Currency symbol changes display only, because the federal thresholds are U.S. dollar amounts. Rounding changes displayed money precision, while the JSON output keeps numeric values.
If the sale mixes asset types, split the estimate before trusting the result. A single transaction can contain ordinary income, standard long-term gain, collectibles gain, unrecaptured section 1250 gain, depreciation recapture, excluded home-sale gain, and state-specific treatment.
Interpreting Results:
Total estimated tax adds the modeled federal gains tax, NIIT when included, and the optional state or local planning tax. Read it with Taxable gain, because a low tax can mean a small gain, a loss offset, a home-sale exclusion, or remaining room in the 0% long-term band.
Federal rate is an effective rate on taxable gain, not necessarily the statutory rate. A long-term gain can be split across 0%, 15%, and 20% layers. A short-term gain can be split across ordinary brackets. Special-rate gains are approximated through ordinary brackets capped at 28% for collectibles or section 1202 gain and 25% for unrecaptured section 1250 gain.
| Output | Meaning | Check before relying on it |
|---|---|---|
| Realized gain / loss | Sale proceeds minus selling costs and adjusted basis | Basis records, acquisition costs, improvements, exchange fees, and property adjustments. |
| Taxable gain | Positive gain after modeled losses and exclusions | Capital loss character, carryover ordering, home-sale eligibility, and any manual exclusion. |
| Tax Layer Ledger | Federal layers plus NIIT and state/local planning rows when they apply | Whether the gain treatment matches the asset and whether MAGI is current. |
| Planning Review | Signals for zero-rate room, NIIT threshold room, loss offsets, classification, and source review | Warnings and source dates before using the estimate for payment planning. |
| Sale Tax Curve | Sensitivity of tax to sale proceeds around the current amount | The scenario swing and whether basis, losses, and exclusions would stay unchanged at those sale prices. |
A capital loss result is not the same as a final loss deduction. The calculator can show a modeled loss or unused loss offset signal, but federal annual loss deduction limits, short-term versus long-term netting, and carryover worksheets need separate filing treatment.
Technical Details:
The calculation first builds the gain base, then applies exclusions and offsets before any tax rates. It treats negative entries as zero for money inputs where the form expects a nonnegative amount.
Formula Core
| Step | Formula | Purpose |
|---|---|---|
| Adjusted basis | cost basis + basis additions |
Captures supported basis increases before gain is measured. |
| Realized gain or loss | sale proceeds - selling costs - adjusted basis |
Measures the raw sale result before tax offsets. |
| Positive gain | max(0, realized gain) |
Prevents exclusions and gain rates from applying to a loss. |
| Taxable gain | max(0, positive gain - home exclusion - loss offsets - manual exclusion) |
Creates the gain amount that flows into federal, NIIT, and state/local layers. |
| Total tax | federal gains tax + NIIT + state/local planning tax |
Combines the modeled tax layers into the headline estimate. |
For standard long-term gains, the taxable gain stacks on top of other taxable income. The calculator fills available room in the 0% preferential band, then the 15% band, then applies 20% to any remaining amount. For short-term gains, it allocates taxable gain through the ordinary bracket schedule for the selected filing status and tax year.
| Gain treatment | Federal rate path | Important boundary |
|---|---|---|
| Standard long-term | 0%, 15%, and 20% preferential bands stacked over other taxable income | Holding period and netting must support long-term treatment. |
| Short-term | Ordinary income brackets for the selected year and filing status | Usually applies when the asset was held one year or less. |
| Collectibles / section 1202 | Ordinary brackets capped at a 28% maximum | Mixed gains should be separated from standard long-term gain. |
| Unrecaptured section 1250 | Ordinary brackets capped at a 25% maximum | Only the unrecaptured section 1250 portion belongs here. |
| Main home sale | Modeled section 121 exclusion first, then standard long-term bands on any taxable remainder | Ownership, use, timing, nonqualified-use, depreciation, and reporting rules are not decided by the calculator. |
| Custom flat federal rate | User-entered flat federal gain rate on taxable gain | Use only when a verified rule or adviser gives a specific rate. |
The built-in 2025 and 2026 preferential thresholds match the IRS source set used by the tool. The values below are the maximum taxable income amounts for the 0% and 15% long-term capital gain bands. Gain above the 15% maximum amount reaches the 20% long-term band.
| Tax year | Filing status | 0% through | 15% through |
|---|---|---|---|
| 2026 | Single | $49,450 | $545,500 |
| 2026 | Married filing jointly / surviving spouse | $98,900 | $613,700 |
| 2026 | Married filing separately | $49,450 | $306,850 |
| 2026 | Head of household | $66,200 | $579,600 |
| 2025 | Single | $48,350 | $533,400 |
| 2025 | Married filing jointly / surviving spouse | $96,700 | $600,050 |
| 2025 | Married filing separately | $48,350 | $300,000 |
| 2025 | Head of household | $64,750 | $566,700 |
NIIT is optional in the form, but when it is included the calculator uses the individual threshold for the selected filing status. The modeled NIIT base is min(taxable gain, max(0, MAGI before gain + taxable gain - NIIT threshold)), and the tax is 3.8% of that base.
| Filing status | MAGI threshold |
|---|---|
| Single | $200,000 |
| Married filing jointly / surviving spouse | $250,000 |
| Married filing separately | $125,000 |
| Head of household | $200,000 |
Digital assets, stocks, bonds, funds, real estate, and other capital assets still need classification outside the calculator. The estimate does not import lots, determine specific identification, apply wash-sale or straddle rules, handle installment-sale timing, model depreciation recapture beyond the selected special-rate path, or prepare Form 8949, Schedule D, Form 8960, or state returns.
Limitations, Privacy, and Accuracy:
This is an educational planning estimate for U.S. federal individual tax rules covered by the selected inputs. It is not tax, legal, investment, or filing advice. Tax law, IRS guidance, state rules, asset classification, basis records, and personal facts can change the final answer.
The state and local input is deliberately simple. It applies one flat percentage to taxable gain and does not model residency, sourcing, state-specific deductions, exemptions, credits, brackets, alternative taxes, local taxes, or state treatment of federal exclusions.
The calculator does not need account credentials, brokerage access, or tax transcripts. Use anonymized scenario labels when exporting or sharing results, because copied rows, DOCX files, CSV files, charts, and JSON can include sale amounts, income estimates, MAGI, and other sensitive financial assumptions.
Before using the output for estimated tax payments or sale timing, verify the tax year, filing status, taxable income before gain, MAGI before gain, basis, holding period, loss carryovers, home-sale eligibility, and every special-rate category with official records or a qualified tax adviser.
Worked Examples:
Standard long-term stock sale
Assume a 2026 single filer sells stock for $185,000, has $118,000 of cost basis, $4,500 of basis additions, $1,200 of selling costs, $72,000 of other taxable income, and $2,500 of capital loss offsets. Realized gain is $185,000 - $1,200 - $122,500, or $61,300. After the $2,500 loss offset, taxable gain is $58,800.
The 2026 single 0% long-term band ends at $49,450, so the $72,000 of other taxable income already uses it. The $58,800 taxable gain falls in the 15% band, producing about $8,820 of federal gains tax. MAGI after the gain is below the $200,000 single NIIT threshold, so NIIT is $0 in this scenario.
Short-term gain with NIIT
A 2026 single filer with $60,000 of other taxable income sells an asset held one year or less and has $30,000 of taxable short-term gain. The short-term mode puts that gain through ordinary brackets, so the gain sits in the 22% bracket under these assumptions and produces about $6,600 of federal tax. If MAGI before gain is $220,000 and NIIT is included, the NIIT base is $30,000 and NIIT adds $1,140.
Main home estimate with exclusion
A married couple filing jointly sells a main home for $800,000, pays $50,000 of selling costs, and has $470,000 of adjusted basis. The realized gain is $280,000. If they qualify for the full $500,000 exclusion, the modeled home-sale exclusion absorbs the gain and taxable gain is $0. The tax result still depends on eligibility, depreciation, nonqualified-use, reporting documents, and other facts that this calculator does not decide.
FAQ:
Does this calculate my final tax return?
No. It estimates one capital gain scenario using the selected inputs. A final return may need lot-level records, netting against other gains and losses, Form 8949, Schedule D, Form 8960, state forms, estimated tax rules, and adviser review.
Why does other taxable income affect a long-term capital gain?
Preferential long-term bands are based on taxable income. The calculator stacks the gain above other taxable income, so existing taxable income can use the 0% room before the sale is added.
Should I include NIIT?
Include NIIT when your MAGI and net investment income may exceed the filing-status threshold. The calculator estimates NIIT on the lesser of taxable gain or MAGI over the threshold, but a real Form 8960 calculation can include other investment income and adjustments.
Can I use it for crypto?
You can model a digital asset sale when it is held as a capital asset and you know the proceeds, basis, fees, holding period, and loss offsets. The calculator does not identify lots, reconstruct wallet history, decide ordinary-income events, or prepare digital asset reporting.
Why is the state or local tax only a flat rate?
State and local capital gain rules vary widely. A flat planning rate can size a rough reserve, but it cannot replace a jurisdiction-specific calculation.
Glossary:
- Adjusted basis
- Cost basis plus supported additions or adjustments, such as capital improvements or acquisition costs.
- Realized gain
- Sale proceeds minus selling costs and adjusted basis before losses and exclusions are applied.
- Taxable gain
- The positive gain remaining after modeled loss offsets and exclusions.
- MAGI
- Modified adjusted gross income, used by the NIIT threshold calculation.
- NIIT
- Net Investment Income Tax, a 3.8% tax that can apply when investment income and MAGI exceed the filing-status threshold.
- Unrecaptured section 1250 gain
- A real-property gain category that can be taxed at ordinary rates up to a 25% maximum.
- Section 121 exclusion
- The main-home sale exclusion that can remove up to $250,000 of gain, or up to $500,000 for qualifying joint filers, when the rules are met.
References:
- IRS Topic no. 409, Capital gains and losses, for capital asset, holding-period, preferential rate, special-rate, loss limit, and reporting context.
- IRS Revenue Procedure 2025-32, for 2026 ordinary bracket and maximum capital gains rate threshold amounts.
- IRS Federal income tax rates and brackets, for 2025 ordinary bracket schedules and IRS pointers to 2026 rates.
- IRS Topic no. 559, Net investment income tax, for the 3.8% NIIT formula and individual MAGI thresholds.
- IRS Topic no. 701, Sale of your home, for the $250,000/$500,000 home-sale exclusion and eligibility cautions.
- IRS Publication 550 (2025), Investment Income and Expenses, for investment property, loss carryover, special-rate gain, and digital asset context.