Capital gains tax calculator for federal gain, loss offsets, and after-tax proceeds Estimate 2025 or 2026 US federal tax on a taxable asset sale using cost basis, sale price, taxable income before the sale, short-term versus long-term treatment, and the optional net investment income tax.
Display currency
The tax rules stay US federal; currency only changes how amounts are displayed.
Scenario shortcuts
Holding period
Result
$8,550.00
Estimated 2026 US federal long-term tax on a net taxable gain of $57,000.00 for single. No NIIT is estimated from the entered income.
Net taxable gain
$57,000.00
After-tax proceeds
$138,450.00
Capital gains tax before NIIT
$8,550.00
Estimated NIIT
$0.00
Effective tax rate on gain
15%
Top federal rate used
15%
Transaction summary
Sale price $150,000.00 minus selling costs of $3,000.00 leaves $147,000.00 in net sale proceeds before federal tax. Cost basis used: $90,000.00. Other taxable income entered: $70,000.00.
Rate-band planning context
Before this sale, the entered income leaves $0.00 of 0% long-term capital-gains room and $475,500.00 of 15% room under the 2026 thresholds.
Federal tax breakdown
Band
Gain taxed
Tax
15% long-term capital gains band
$57,000.00
$8,550.00
Scope note
This is a US federal estimate for a standard taxable asset sale. Review special rules separately for primary-home exclusions, collectibles, depreciation recapture, wash-sale limits, state taxation, and any MAGI adjustments that change NIIT exposure.
Capital gains tax calculator guide: basis, holding period, and federal rate bands
A capital gains tax calculator estimates US federal tax on a taxable asset sale once you know the sale price, cost basis, selling costs, holding period, filing context, and tax year.
What creates a capital gain
A capital gain usually starts with the amount you realize from the sale, reduced by selling costs such as commissions or certain transaction fees. From that net proceeds figure, you subtract the assetβs cost basis to determine whether you have a gain or a loss.
Cost basis is not always just the original purchase price. Depending on the asset, basis can be adjusted by reinvested amounts, certain improvements, splits, or prior tax adjustments. That is why calculators in this category work best when you already know the basis figure you need to test rather than when you are still trying to reconstruct it from account history.
Net proceeds = Sale price - Selling costs
The sale amount that matters for capital-gains tax is what remains after allowable selling costs are deducted from the gross selling price.
Realized gain (or loss) = Net proceeds - Cost basis
Comparing net proceeds with basis determines whether the transaction produces a gain or a capital loss.
Short-term versus long-term treatment
Holding period matters because federal capital gains tax does not treat all gains the same way. In broad terms, gains on assets held for more than one year can qualify for long-term capital-gains rates, while shorter holding periods generally push the gain into ordinary-income brackets.
That difference can materially change the tax result. A long-term gain may be split across 0%, 15%, and 20% federal bands depending on your taxable income, whereas a short-term gain is generally taxed using ordinary marginal brackets. The calculator models that distinction directly.
How taxable income changes long-term rates
Long-term capital gains are not taxed in isolation. Your other taxable income determines how much room remains in the 0% and 15% bands before any part of the gain reaches the next federal rate tier.
That is why this calculator asks for other taxable income excluding the transaction being modeled. A gain can be split across multiple rate bands in the same year, so the result should be read as a layered estimate rather than as one single flat rate applied to the whole gain.
For 2026 planning, the calculator uses IRS Revenue Procedure 2025-32 thresholds. For 2025 planning, it keeps the prior-year federal thresholds available so users can compare a completed sale year with a current-year estimate without changing calculators.
When the 3.8% net investment income tax can apply
Higher-income taxpayers may also need to estimate the net investment income tax, often shortened to NIIT. The NIIT is not the same as the 0%, 15%, or 20% long-term capital-gains rate; it is a separate 3.8% federal tax applied to the lesser of net investment income or the amount by which modified adjusted gross income exceeds the filing-status threshold.
This calculator includes an optional NIIT estimate by treating the entered other taxable income plus the net gain as a planning proxy for the threshold test. That is useful for a quick capital gains tax estimate, but the final filing answer can change if deductions, exclusions, or other MAGI adjustments differ from taxable income.
Further reading
IRS: Net Investment Income Tax β Official IRS explanation of the 3.8% NIIT, including the filing-status thresholds used for the optional planning estimate.
Worked example: a 14,000 long-term taxable gain
Suppose an asset sells for 50,000, the cost basis is 35,000, and selling costs are 1,000. Net proceeds are 49,000 and the realized gain is 14,000. If the filer already has 40,000 of other taxable income and the gain qualifies for long-term treatment, part of the gain can still fit inside the 0% federal band before the remainder reaches 15%.
That split-rate treatment is why a capital gains calculator is more useful than simply multiplying the gain by 15% or 20%. The correct federal result depends on filing status, taxable-income stacking, and whether any loss carryovers offset the gain first.
Further reading
IRS Topic No. 409: Capital gains and losses β Official IRS overview of capital-gains and capital-loss treatment, including the distinction between short-term and long-term treatment.
This tool is intentionally scoped to a standard federal planning estimate. It does not apply the primary-home exclusion, collectibles rates, Section 1250 recapture, wash-sale rules, opportunity-zone adjustments, or state income-tax treatment. The NIIT option is included as a planning estimate, but it does not replace a full modified-AGI calculation.
Those omissions matter because capital gains rules vary substantially by asset type. If the transaction involves a home sale, real-estate depreciation recapture, employee stock compensation, or a large investment portfolio with multiple offsetting positions, you should treat the calculator as a first-pass planning check rather than as a filing answer.
Why other taxable income and filing status matter
Long-term gains are not taxed on a separate island. Your other taxable income fills the 0% and 15% rate bands first, so the same gain can produce very different tax results depending on the filer's overall income picture. Filing status changes those thresholds, which is why married-filing-jointly results can differ meaningfully from single-filer results on the same sale.
Short-term gains are simpler in one sense because they generally flow into the ordinary-income brackets instead of the preferential capital-gains bands. That also means they can be affected by the rest of your taxable income in the same way ordinary wages are.
How capital losses and carryovers change the answer
Capital losses offset capital gains before you ever get to the rate bands. If you have prior-year carryovers, those can reduce the taxable gain first and may even turn a sale into a net capital loss for the year. That is why this calculator asks for both current loss offsets and the rest of your taxable income.
When losses exceed gains, only a limited amount can usually offset ordinary income in the current year, with the remainder carried forward. That treatment is one of the most important planning differences between a paper loss and a loss that still has tax value.
State tax and reporting still need separate review
Federal capital gains tax is only one part of the picture. Many taxpayers also owe state income tax, and the reporting mechanics still run through Schedule D and supporting IRS worksheets. Those steps can matter even when the federal result looks straightforward.
For high-value sales, you should also check whether the transaction has reporting thresholds, basis documentation issues, or special asset-specific rules. A calculator can surface the planning estimate quickly, but it cannot replace the actual filing forms and supporting records.
How to use the result for tax planning
Use the result as a decision aid before you sell, not just as a post-sale tax number. Comparing a long-term sale with a short-term sale can show the value of waiting until the holding period qualifies, while the rate-band planning context can show whether other income is already filling the lower long-term capital-gains bands.
The scenario shortcuts are designed for those common planning questions: a standard long-term stock sale, a short-term trade, a loss-carryover case, and a high-income NIIT check. Those examples are intentionally editable, so you can start from a realistic pattern and then replace every amount with your own sale price, cost basis, selling costs, income, and loss carryovers.
Frequently asked questions
What is the difference between short-term and long-term capital gains?
Short-term gains are generally taxed using ordinary-income rates, while long-term gains may qualify for preferential 0%, 15%, or 20% federal rates. The holding period is a major driver of the result.
Why does the calculator ask for other taxable income?
Because long-term capital-gains rates depend on how much taxable income you already have before the gain is added. The gain can be split across multiple federal rate bands in the same year.
Do capital loss carryovers reduce capital gains tax?
Yes. Capital loss carryovers can offset gains first. If losses still remain after offsetting gains, only a limited amount can usually reduce ordinary income in the current year, with the rest carried forward.
Does this estimate cover home-sale exclusions or state tax?
No. This version is a US federal estimate for a standard taxable asset sale only. Home-sale exclusions, depreciation recapture, state tax, and asset-specific adjustments need separate review.
Why does other taxable income change long-term capital gains tax?
Because long-term gains are layered on top of your other taxable income. The 0% and 15% bands have income thresholds, so more other income can push part of the gain into a higher rate band.
Can capital losses reduce ordinary income?
Yes, but only up to the annual limit that applies to your filing status. Any remaining loss generally carries forward to later years.
Does this calculator include state capital gains tax?
No. State tax rules vary widely and are not included in this federal estimate. You should model state tax separately if it applies to your sale.
Do short-term gains and long-term gains use the same rate bands?
No. Short-term gains generally use ordinary-income brackets, while long-term gains use the preferential 0%, 15%, and 20% federal capital-gains bands.
Can I use this as a 2026 capital gains tax calculator?
Yes. Select 2026 in the tax-year control to use the current federal ordinary-income brackets and long-term capital-gains thresholds from IRS Revenue Procedure 2025-32.
Does the calculator include the 3.8% net investment income tax?
It can. Leave the NIIT checkbox enabled to estimate the 3.8% tax when the entered income and gain exceed the filing-status threshold. Treat that line as a planning estimate because the official NIIT test uses modified adjusted gross income.
Why does the result separate capital gains tax before NIIT?
Separating the base capital-gains tax from estimated NIIT makes it easier to see whether the sale is mainly affected by the preferential gain bands or by the additional high-income investment tax.
Is this a capital gains tax calculator for stocks?
It can be used for a standard taxable stock sale if you know the sale price, cost basis, selling costs, holding period, filing status, and other taxable income. Employee stock compensation, wash sales, and basis adjustments still need separate review.