Capital Gains Tax Calculator
Estimate U.S. capital gains tax from sale proceeds, basis, income, losses, and gain treatment with federal bands, NIIT, and scenarios.- {{ 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
The tax cost of selling an asset starts with the gain, not the sale price. Cash from a broker statement, exchange, or closing table still has to be reduced by selling costs and compared with adjusted basis before federal capital gains rules can say what portion is taxable.
Capital gain estimates change because several facts stack on top of that first subtraction. Holding period separates short-term gain from long-term gain, other taxable income can use up the lower long-term rate bands before the sale is added, and modified adjusted gross income (MAGI) can trigger Net Investment Income Tax (NIIT) even when the regular capital gain rate does not change.
The same dollar gain can therefore lead to very different estimates. A long-held stock sale may fall partly in the 0% long-term capital gain band. A short-term crypto trade is usually taxed through ordinary income brackets. A collectible, qualified small business stock amount, or unrecaptured section 1250 real estate amount can have a special federal maximum rate. A main-home sale may be partly or fully excluded, but only when the ownership, use, timing, reporting, and depreciation facts support that treatment.
- Proceeds
- The gross sale amount before selling costs and tax.
- Adjusted basis
- Cost basis plus supported additions, such as acquisition costs, reinvested adjustments, or capital improvements.
- Realized gain
- Proceeds minus selling costs and adjusted basis. A negative number is a modeled capital loss, not a finished loss deduction.
- Taxable gain
- The positive gain left after modeled loss offsets and eligible exclusions.
Planning is most useful before a sale is locked in. A pre-sale estimate can show whether selling this year is likely to use the 0% long-term band, cross into a higher federal band, trigger NIIT, or leave enough room for loss harvesting. It can also show when a small change in price does not change the tax much because basis, exclusions, or loss offsets absorb most of the movement.
Two common mistakes distort the result. One is treating gross proceeds as the gain, which ignores basis and selling costs. The other is choosing a rate category before confirming asset character, holding period, depreciation history, home-sale eligibility, or lot-level records.
A federal estimate still depends on records outside the arithmetic. Basis needs support from statements, closing documents, gift or inheritance records, or improvement records. Holding period and asset character decide which federal rate rule applies. State and local tax can differ sharply from the federal result, so a planning number should not be treated as a completed return.
How to Use This Tool:
Use the calculator as a scenario planner for one sale or one clean asset component at a time. Split mixed transactions before entering values, because short-term gain, long-term gain, collectibles gain, unrecaptured section 1250 gain, excluded home-sale gain, and state-specific treatment can belong in different calculations.
- Choose the Tax year, Filing status, and Gain treatment. The gain treatment controls whether the federal estimate uses long-term preferential bands, ordinary income brackets, a 25% or 28% maximum-rate path, a main-home exclusion path, or a custom flat federal rate.
- Enter Sale proceeds, Cost basis, Basis additions / adjustments, and Selling costs. Use records that match the same lot, token batch, fund shares, property component, or home-sale calculation you are testing.
- Add Other taxable income before gain and MAGI before gain. Long-term capital gain bands use taxable income, while NIIT uses MAGI, so do not substitute gross wages for both fields.
- Enter Capital loss offsets / carryovers and any eligible exclusion. For a main-home sale, choose the section 121 exclusion amount only after checking the ownership, use, timing, and reporting rules. Use Other verified exclusion / adjustment only for an amount you can support.
- Set State / local rate to 0 for a federal-only estimate, or enter a verified combined planning rate. The state/local amount is a flat percentage on taxable gain, not a jurisdiction-specific return calculation.
- Turn NIIT on when MAGI and investment income may exceed the filing-status threshold. Use Scenario sale swing, Rounding, and Scenario label to compare sale-price sensitivity and keep exports recognizable.
- Start with the headline estimate, then audit Gain Snapshot, Tax Layer Ledger, Planning Review, Federal Gain Layer Chart, Sale Tax Curve, and Sale Scenario Table. If warnings appear, fix the underlying assumption or treat the output as a stop-and-review estimate.
A taxable gain of $0 needs its own review. It may come from a true loss, a loss offset, a home-sale exclusion, or another modeled adjustment, and each path has different filing and recordkeeping consequences.
Interpreting Results:
Total estimated tax combines the modeled federal gains tax, NIIT when included, and the optional state/local planning amount. Read it beside Taxable gain and Realized gain / loss, because a low tax can mean the sale is small, the gain is excluded, losses are being used, or the long-term 0% band still has room.
Federal rate is an effective rate on taxable gain. It is not always the next marginal rate on another dollar of sale proceeds. Long-term gain may be split across 0%, 15%, and 20% bands; short-term gain is allocated through ordinary brackets; special-rate categories use ordinary brackets capped at the selected maximum.
| Output | What to read | What to verify |
|---|---|---|
| Gain Snapshot | How proceeds, basis, costs, losses, exclusions, NIIT, and state/local tax form the estimate. | Basis records, selling-cost records, and whether the chosen gain treatment matches the asset. |
| Tax Layer Ledger | The gain amounts assigned to federal rate bands, NIIT, and state/local planning tax. | Other taxable income and MAGI before gain, because those inputs can move dollars into different bands. |
| Planning Review | Signals for zero-rate room, NIIT threshold room, loss offsets, classification, and source review. | Warnings, source dates, and assumptions before using the number for estimated payments. |
| Sale Tax Curve | How total tax changes when sale proceeds move within the selected scenario swing. | Whether basis, losses, exclusions, and gain treatment would stay the same at those sale prices. |
| Sale Scenario Table | Taxable gain, total tax, and after-tax gain across the tested sale prices. | Whether the current sale row matches the transaction you actually plan to make. |
Do not treat a clean-looking estimate as proof that the sale is filing-ready. Capital loss limits, carryover ordering, wash-sale or straddle rules, specific identification, installment timing, depreciation recapture, Form 8949 reporting, and state returns may still change the final return.
Technical Details:
Federal capital gain math has two separate jobs. The first job measures the gain from the transaction. The second job applies the right tax rule to the portion that remains taxable. Keeping those jobs separate prevents common mistakes, such as applying a home-sale exclusion before measuring the sale gain, using MAGI as taxable income, or treating a short-term gain as if it qualified for long-term rates.
Long-term capital gains use taxable income bands rather than a flat rate for every taxpayer. Other taxable income fills the lower part of the band structure first, then the gain is added above it. NIIT has a different threshold test based on MAGI and net investment income, so the NIIT result can change even when the preferential long-term capital gain rate stays the same.
Formula Core
The core estimate subtracts supported basis and transaction costs before losses, exclusions, and tax rates are applied.
| Term | Source in the estimate | Effect |
|---|---|---|
| Adjusted basis | Cost basis plus basis additions / adjustments | Higher basis reduces realized gain. |
| Positive gain | Realized gain floored at $0 before exclusions and rates | Prevents exclusions and gain rates from applying to a loss. |
| Taxable gain | Positive gain after modeled losses and exclusions | Flows into federal, NIIT, and state/local tax amounts. |
| NIIT base | Lesser of taxable gain or MAGI above the filing-status threshold | Multiplied by 3.8% when NIIT is included. |
| State/local planning tax | Taxable gain multiplied by the entered flat state/local rate | Adds a rough non-federal reserve, not a state return calculation. |
A 2026 single filer with $185,000 of proceeds, $118,000 of cost basis, $4,500 of basis additions, and $1,200 of selling costs has $122,500 of adjusted basis and $61,300 of realized gain. If $2,500 of capital losses are applied, taxable gain is $58,800. With $72,000 of other taxable income, the long-term federal amount falls in the 15% band and produces about $8,820 of federal gains tax before any state/local amount.
Federal Rate Rules
| Gain treatment | Rate path | Boundary to check |
|---|---|---|
| Standard long-term | 0%, 15%, and 20% preferential bands stacked above other taxable income. | Holding period generally must be more than one year, after applying any exceptions and netting rules. |
| 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 rate. | Only the gain portion that belongs in the 28% category should use this path. |
| Unrecaptured section 1250 | Ordinary brackets capped at a 25% maximum rate. | Only the unrecaptured section 1250 real-property portion belongs here. |
| Main home sale | Modeled section 121 exclusion first, then standard long-term bands on any taxable remainder. | Eligibility, nonqualified use, depreciation, and reporting rules are separate from the arithmetic. |
| Custom flat federal rate | Entered federal rate multiplied by taxable gain. | Use only when a verified rule or adviser gives a specific rate. |
The long-term thresholds below are the maximum taxable income amounts for the 0% and 15% bands used by the estimate. Taxable income above the 15% maximum 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 |
| Filing status | MAGI threshold |
|---|---|
| Single | $200,000 |
| Married filing jointly / surviving spouse | $250,000 |
| Married filing separately | $125,000 |
| Head of household | $200,000 |
Money entries that should not be negative are treated as nonnegative amounts. Display rounding can show cents or whole dollars, while exported numeric values preserve the underlying numbers. This matters when a sale sits close to a band edge or NIIT threshold, because a rounded display may hide a small amount that still affects a filing worksheet.
Digital assets are treated as property for U.S. federal tax purposes when they have the characteristics of a digital asset, and dispositions can need Form 8949 reporting. The estimate does not reconstruct lots, choose specific identification, decide ordinary-income events, apply wash-sale or straddle rules, handle installment-sale timing, or prepare Schedule D, Form 8960, or a state return.
Limitations, Privacy, and Accuracy:
This is an educational planning estimate for U.S. federal individual tax rules represented by the selected inputs. It is not tax, legal, investment, or filing advice. Tax law, IRS guidance, basis records, asset character, state rules, and personal facts can change the final answer.
- The state/local amount is one flat planning percentage on taxable gain; it does not model residency, sourcing, brackets, credits, or local rules.
- Main-home results assume the exclusion amount is already justified; the calculator does not decide section 121 eligibility.
- Special-rate categories are estimates for the selected category only; mixed gains should be split before relying on the result.
- Exports, copied rows, charts, and JSON can include sale amounts, income estimates, MAGI, and scenario labels, so treat them as sensitive financial notes.
- Before using the output for estimated tax payments or sale timing, verify the tax year, filing status, taxable income, MAGI, basis, holding period, loss carryovers, exclusions, and special-rate category with official records or a qualified tax adviser.
Worked Examples:
Standard long-term stock sale
A 2026 single filer sells stock for $185,000 with $118,000 of cost basis, $4,500 of basis additions, $1,200 of selling costs, $72,000 of other taxable income, $92,000 of MAGI before gain, and $2,500 of loss offsets. Gain Snapshot shows $61,300 of Realized gain / loss and $58,800 of Taxable gain. Because other taxable income already exceeds the 2026 single 0% threshold, Federal gains tax is about $8,820 in the 15% band and Net Investment Income Tax is $0.
Long-term gain split across the 0% and 15% bands
A married couple filing jointly in 2026 has $94,000 of other taxable income and a $9,000 taxable long-term gain. The 0% band runs through $98,900, so Tax Layer Ledger places $4,900 in the 0% preferential band and the remaining $4,100 in the 15% band. The resulting Federal gains tax is about $615 before NIIT or any state/local planning rate.
Short-term gain with NIIT
A 2026 single filer with $60,000 of other taxable income and $220,000 of MAGI before gain sells an asset held one year or less and has $30,000 of taxable short-term gain. Short-term treatment sends the gain through ordinary brackets, so Federal gains tax is about $6,600. With NIIT included, MAGI after the gain is $250,000, the Net Investment Income Tax base is $30,000, and NIIT adds $1,140.
Capital loss warning
If sale proceeds are $90,000, adjusted basis is $95,000, and selling costs are $2,000, Realized gain / loss is -$7,000 and Taxable gain is $0. The warning about a modeled capital loss matters because annual deduction limits, short-term versus long-term netting, and carryover ordering still need separate tax-return treatment.
FAQ:
Can this estimate my final tax return?
No. It estimates one capital gain scenario from the selected inputs. A return may need lot-level records, Form 8949, Schedule D, Form 8960, state forms, estimated tax rules, and adviser review.
Why does other taxable income change a long-term gain?
Long-term capital gain bands are based on taxable income. Other taxable income fills the lower band amounts first, so the same gain can be taxed differently when income before the sale changes.
When should I include NIIT?
Include NIIT when MAGI and net investment income may exceed the filing-status threshold. The estimate applies 3.8% to the lesser of taxable gain or MAGI above the threshold, but a full Form 8960 calculation can include other investment income and adjustments.
Can I use it for crypto or other digital assets?
Yes, when the disposition is treated as a capital asset sale and you know the proceeds, basis, fees, holding period, and loss offsets. It does not reconstruct wallet history, choose lots, decide ordinary-income events, or prepare digital asset reporting.
Why did taxable gain become $0?
Check Gain Snapshot. A $0 taxable gain may come from a realized loss, loss offsets, a home-sale exclusion, or another verified exclusion, and each reason needs different records before you rely on the result.
Glossary:
- Adjusted basis
- Cost basis plus supported additions or adjustments, such as acquisition costs, reinvested adjustments, or capital improvements.
- 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, Internal Revenue Service, updated February 25, 2026.
- IRS Revenue Procedure 2025-32, Internal Revenue Service.
- IRS Federal income tax rates and brackets, Internal Revenue Service.
- IRS Topic no. 559, Net investment income tax, Internal Revenue Service, updated April 2, 2026.
- IRS Topic no. 701, Sale of your home, Internal Revenue Service, updated January 22, 2026.
- IRS Publication 550 (2025), Investment Income and Expenses, Internal Revenue Service, 2025.