TheCalculatorHive
USA only

Capital Gains Tax Calculator

Estimate your 2026 US federal capital gains tax on an asset sale — short-term vs long-term, stacked on your other income, with effective rate and net proceeds.

$
$
$

Results update live as you type

Capital gains tax
Capital gain or loss
Effective rate on gain
Net proceeds after tax
Net gain after tax

Proceeds breakdown

How your sale proceeds split into your recovered cost basis, the tax owed, and the gain you keep.

Like this? Share: Email

What is the capital gains tax calculator?

When you sell an asset — stock, a mutual fund, cryptocurrency, or investment property — for more than you paid, the profit is a capital gain, and the IRS taxes it. This calculator estimates your 2026 US federal capital gains tax from four inputs: your cost basis, your sale proceeds, how long you held the asset, and your other taxable income. It returns the gain, the tax, your blended effective rate on the gain, and what you actually keep after tax.

The single biggest lever is the holding period. Sell within one year and the profit is a short-term gain taxed at your ordinary-income rate — the same brackets a federal income tax calculator uses. Hold for more than a year and the gain qualifies for the far lower long-term rates of 0%, 15%, or 20%.

How the calculation works

Your gain is simply proceeds minus cost basis. If that number is negative you have a capital loss, and this tool shows zero tax (losses are never taxed). From there the path forks on the holding period:

  • Short-term (held one year or less): the gain is stacked on top of your other taxable income and taxed at your ordinary marginal brackets. The tax shown is the incremental amount the gain adds — ordinaryTax(income + gain) − ordinaryTax(income) — so the effective rate reflects the real marginal impact, not a flat top rate.
  • Long-term (held more than one year): the gain uses the preferential 0/15/20% rates with the IRS stacking method. Your gain sits on top of your other income, and the rate bands are measured against your total taxable income (other income + gain).

amountAt0 = clamp(zeroRateMax − otherIncome, 0, gain)
amountAt15 = clamp(fifteenRateMax − max(otherIncome, zeroRateMax), 0, gain − amountAt0)
amountAt20 = gain − amountAt0 − amountAt15
tax = 0 × amountAt0 + 0.15 × amountAt15 + 0.20 × amountAt20

Because long-term gains stack on your other income, the same gain can be taxed at 0%, 15%, or 20% depending on how much you already earn — and a large gain can push part of itself into a higher band. Selling in a lower-income year, or holding one extra day past the one-year mark, can meaningfully cut the bill.

2026 long-term capital gains brackets

These thresholds (total taxable income) come from IRS Revenue Procedure 2025-32 for tax year 2026. Above the 15% threshold, the 20% rate applies.

Filing status0% up to15% up to20% above
Single$49,450$545,500$545,500
Married filing jointly$98,900$613,700$613,700
Married filing separately$49,450$306,850$306,850
Head of household$66,200$579,600$579,600

Worked example

Generated by the same engine that powers the calculator, so these figures always match the tool.

StepValue
Sale proceeds$50,000
Cost basis$10,000
Capital gain (proceeds − basis)$40,000
Other taxable income$80,000
Long-term rate band it lands in15%
Capital gains tax$6,000.00
Effective rate on gain15.00%
Net proceeds after tax$44,000.00
Net gain after tax$34,000.00

Short-term vs long-term: the same gain, two very different bills

Holding past the one-year mark is often the highest-value move an investor can make. On an identical $40,000 gain for a single filer earning $80,000, the ordinary-income rate on a short-term sale far exceeds the 15% long-term rate:

On a $40,000 gainShort-termLong-term
How it's taxedOrdinary income0 / 15 / 20%
Capital gains tax$9,086.00$6,000.00
Effective rate on the gain22.71%15.00%
You keep (net gain after tax)$30,914.00$34,000.00

If you are weighing a sale against staying invested, pairing this with an ROI calculator or a Roth IRA calculator (where qualified withdrawals are tax-free) helps you see the after-tax picture, not just the headline return.

Ways investors commonly reduce a capital gains tax bill

Beyond simply holding an asset past the one-year mark, a few widely-used strategies can lower — or entirely defer — the tax this calculator estimates. None of these are modeled in the figures above; think of them as the next questions to ask once you know your baseline number:

  • Tax-loss harvesting. Selling a losing position in the same year realizes a capital loss that offsets capital gains dollar-for-dollar, with up to $3,000 ($1,500 if married filing separately) of any excess loss deductible against ordinary income and the rest carried forward.
  • Using tax-advantaged accounts. Gains inside a 401(k), traditional IRA, or Roth IRA aren't taxed as capital gains at all — see our Roth IRA calculator for how tax-free growth compares over time.
  • A 1031 like-kind exchange (real estate only). Rolling the proceeds of an investment property sale directly into another investment property can defer the capital gain under IRC Section 1031, rather than triggering tax in the year of sale.
  • Donating appreciated securities. Gifting long-term-held stock or funds directly to a qualified charity avoids capital gains tax on the appreciation entirely, while still generally allowing a deduction for the fair market value.
  • The step-up in basis at death. Assets passed to heirs generally receive a cost basis reset to fair market value as of the date of death (IRC Section 1014), which can eliminate the built-in gain that would otherwise have been taxable to the original owner.

These are general federal rules, not personalized advice — confirm eligibility with a tax professional or IRS Publication 550 before relying on any of them.

Assumptions and limitations

  • 2026 US federal only. Uses the tax-year-2026 statutory constants from IRS Rev. Proc. 2025-32. It does not include state or local capital gains tax, which many states levy on top.
  • Other taxable income is entered as already-taxable (after your standard or itemized deduction) — the tool does not re-derive it from gross pay and deductions.
  • No NIIT. The separate 3.8% Net Investment Income Tax can apply above $200,000 (single/HoH), $250,000 (MFJ), or $125,000 (MFS) of modified AGI; it is not modeled here.
  • Single sale in isolation. Capital-loss offsetting across lots, the $3,000/$1,500 annual loss deduction against ordinary income, and loss carryforwards are not modeled — a loss simply produces zero tax.
  • Ordinary capital assets only. Special rates for collectibles (28%), unrecaptured Section 1250 real-estate depreciation (25%), Section 1202 small-business stock, and the Section 121 home-sale exclusion are out of scope.
  • This is an estimate for planning, not tax advice — see IRS Schedule D / Form 8949 or a tax professional.

Frequently asked questions

How is capital gains tax calculated on a sale?+

Your capital gain is the sale proceeds minus your cost basis (what you originally paid, plus improvements or commissions). If you held the asset one year or less, the gain is taxed as ordinary income at your marginal bracket. If you held it more than one year, the gain qualifies for the preferential long-term rates of 0%, 15% or 20%, based on where the gain lands on top of your other taxable income.

What is the difference between short-term and long-term capital gains?+

The IRS draws the line at exactly one year: assets held one year or less generate short-term gains, taxed as ordinary income at your regular marginal rate (up to 37% in 2026). Assets held more than one year generate long-term gains, taxed at the much lower 0%, 15%, or 20% preferential rates — which is why holding an investment past the one-year mark before selling can significantly reduce your tax bill.

What are the 2026 long-term capital gains tax brackets?+

For 2026, single filers pay 0% on long-term gains up to $49,450 of total taxable income, 15% from there up to $545,500, and 20% above that. Married filing jointly: 0% up to $98,900, 15% up to $613,700, 20% above. Head of household: 0% up to $66,200, 15% up to $579,600, 20% above. These thresholds are set by IRS Revenue Procedure 2025-32.

Why does my other income affect my capital gains tax rate?+

Long-term capital gains are taxed using a 'stacking' method: your gain is treated as sitting on top of your other taxable income, and the 0/15/20% bands are measured against your TOTAL taxable income (other income plus the gain), not the gain alone. This means a large gain can push part of itself into a higher band even if your regular income alone would qualify for the 0% rate.

Do I pay capital gains tax on a loss?+

No. If your proceeds are less than your cost basis, you have a capital loss, and this calculator shows zero tax on it. In real tax filing, capital losses can offset capital gains and up to $3,000 ($1,500 if married filing separately) of ordinary income per year, with any excess carried forward to future years — but that offsetting and carryforward math is not modeled here; this tool estimates a single sale in isolation.

What counts as my cost basis?+

Cost basis is generally what you paid to acquire the asset, plus certain additions like capital improvements (for real estate) or brokerage commissions, minus any depreciation already claimed. A higher cost basis means a smaller taxable gain, so keeping records of your original purchase price and any qualifying additions is important for an accurate tax estimate.

Does this calculator include the Net Investment Income Tax (NIIT)?+

No. The 3.8% NIIT is a separate federal tax that can apply on top of capital gains tax when your modified adjusted gross income exceeds $200,000 (single/HoH), $250,000 (MFJ), or $125,000 (MFS). It is out of scope for this calculator's v1 — high earners near those thresholds should factor in the additional 3.8% manually or consult a tax professional.

Is state capital gains tax included?+

No, this calculator estimates federal capital gains tax only. Many states also tax capital gains as ordinary income at their own state rates (a few states, like Texas and Florida, have no state income tax at all), so your total tax bill will typically be higher than the federal figure shown here.

How does selling stock, mutual funds, or real estate differently affect the calculation?+

The core short-term/long-term and 0/15/20% mechanics are the same for stocks, mutual funds, and most real estate held for investment. However, special cases exist outside this calculator's scope: unrecaptured Section 1250 gain on depreciated real estate is capped at 25%, collectibles (art, coins) are capped at 28%, and a primary residence sale may qualify for the Section 121 exclusion (up to $250,000/$500,000 of gain tax-free) — none of which are modeled here.

What's the difference between effective rate and marginal rate on my capital gain?+

The effective rate shown here is your total capital gains tax divided by the gain itself — the true blended rate you paid. Because long-term gains can span two bands (e.g. partly at 0% and partly at 15%), your effective rate is often lower than the top rate your gain reaches, similar to how ordinary income tax brackets work.

Can I reduce my capital gains tax by timing my sale?+

Two common strategies: (1) hold the asset past the one-year mark to qualify for long-term rates instead of ordinary-income rates, and (2) sell in a year when your other taxable income is lower, since long-term gains stack on top of that income and a lower base income can push more of the gain into the 0% or 15% band. Neither strategy is guaranteed to reduce tax in every situation — consult a tax professional for your specific facts.

Is this calculator accurate for cryptocurrency gains?+

The same short-term/long-term and preferential-rate mechanics generally apply to cryptocurrency, which the IRS treats as property. This calculator can estimate the federal tax on a crypto sale using your cost basis and proceeds, but it does not account for crypto-specific reporting nuances (e.g. multiple lots, staking income, or hard forks) — track your basis carefully and consult a tax professional for complex crypto activity.

When do you actually pay capital gains tax on a real estate sale?+

There's no automatic withholding at closing the way there is with a paycheck (foreign sellers are a notable exception under FIRPTA, and a few states withhold at closing). Instead, the gain is reported on your federal return for the year the sale closes, and the tax is due with that return the following spring — or sooner, via estimated quarterly payments, if the gain is large enough that waiting until filing season would trigger an underpayment penalty. If the property was your primary residence, check whether the Section 121 exclusion applies before assuming the whole gain is taxable.

Disclaimer

This calculator is provided for general educational and informational purposes only. Its results are estimates based on the figures you enter and the tax rules in effect for the selected period, which change over time and vary with individual circumstances. It is not tax, legal or accounting advice. Please confirm your position with the official tax authority or a qualified tax professional.

Sources

Formula and data last reviewed by the TheCalculatorHive team on 10 July 2026. Figures are for general information, not professional advice.