Finance Calculator

Capital Gains Tax Calculator

Estimate 2026 U.S. capital gains tax with short/long holding periods, filing-status brackets, cost basis and selling fees, NIIT and optional state-rate scenario.

Estimate U.S. 2026 tax on an investment sale using cost basis, holding period, filing status, other taxable income, and optional NIIT/state scenarios.

Tax year: 2026, U.S. individual federal estimate. Assumes a typical sale of stocks, funds or other ordinary capital assets. Does not model collectibles, depreciation recapture, primary-residence exclusions, AMT, 1250 gains, or special exemptions. For planning only, not filing or tax advice.
Income and deductions: enter other taxable ordinary income after deductions and before this gain (not salary or AGI). For NIIT, enter estimated MAGI before this sale separately. They are not the same number.
Taxable income after deductions, excluding this capital gain and other preferential-rate gains.
Used only for the simplified 3.8% NIIT estimate.
Simplified offset only; full Schedule D netting is not modeled.
Enter your own effective state estimate; this is not state-specific tax law.

This capital gains tax calculator estimates the 2026 U.S. federal tax on an investment sale. It distinguishes short-term and long-term gains, calculates net profit from purchase/sale costs, applies the actual 2026 capital gains tax rate thresholds for each filing status and offers a separate simplified 3.8% Net Investment Income Tax (NIIT) estimate. Use it as a capital gains calculator for planning, not a substitute for preparing Schedule D.

2026 key rates: Most net long-term capital gains can fall in the 0%, 15% or 20% federal rates, depending on taxable income and filing status. Short-term gains are generally taxed at ordinary federal income-tax rates. The applicable long-term bracket may differ from your ordinary marginal tax bracket.

How to use the capital gains tax calculator

  1. Select your 2026 filing status.
  2. Choose automatic holding period and enter purchase and sale dates, or select short-term/long-term manually.
  3. Enter purchase price and qualifying costs added to basis; enter gross sale price and selling expenses.
  4. Enter other taxable ordinary income after deductions before this gain. Do not enter gross salary in this field.
  5. Enter estimated modified adjusted gross income (MAGI) before the sale for the optional NIIT estimate.
  6. Optionally enter an estimated loss offset or a user-supplied state effective rate, then calculate.

The result separates realized gain, modeled taxable gain, regular federal gains tax, estimated NIIT, optional state amount and after-tax gain. It also shows the actual steps so you can check the math.

Capital gains tax formula

Realized capital gain = (sale price − selling expenses) − (purchase price + eligible acquisition costs).

If you bought shares for $20,000 and sold them for $30,000 without relevant fees, your realized gain is $10,000. That is different from the $30,000 total sale proceeds: capital gains tax typically concerns the profit, not the full sale price. Your adjusted tax basis may differ for gifts, inheritances, splits, wash sales and other special cases.

2026 capital gains tax rate table

The official IRS 2026 inflation-adjusted thresholds for the standard 0%/15%/20% long-term gains framework are:

Filing status 0% through taxable income 15% through taxable income 20% above
Single $49,450 $545,500 $545,500
Married filing jointly / qualifying surviving spouse $98,900 $613,700 $613,700
Married filing separately $49,450 $306,850 $306,850
Head of household $66,200 $579,600 $579,600

These thresholds apply to taxable income, including the gains being taxed, rather than to the gain considered in isolation. If your other taxable income already uses the 0% bracket, some or all of the additional gain will fall in the 15% or 20% band. Based on IRS Revenue Procedure 2025-32, Section 4.03.

How to calculate capital gains tax when the gain crosses brackets

Suppose a single taxpayer has $40,000 in other taxable ordinary income and realizes $20,000 in qualifying long-term gain in 2026. The first $9,450 of the gain fills the 0% band up to $49,450. The remaining $10,550 falls in the 15% band, generating approximately $1,582.50 in regular federal capital-gains tax, before possible NIIT or other tax effects.

Short-term vs long-term capital gains

A gain is generally short-term if the investment is held for one year or less, and long-term if held for more than one year. Short-term gains generally enter the ordinary-income tax calculation. This calculator models their incremental ordinary income tax: tax on your starting taxable ordinary income plus the gain, minus tax on the starting income alone.

The standard individual 2026 ordinary federal tax brackets are 10%, 12%, 22%, 24%, 32%, 35% and 37%. The calculator uses the official brackets for single, joint, separate and head-of-household filers; an increase in taxable income can cross more than one bracket.

Do I owe 3.8% Net Investment Income Tax?

The Net Investment Income Tax (NIIT) can impose an additional 3.8% on the lesser of net investment income or MAGI above a separate threshold: $200,000 for single/head of household, $250,000 for joint returns and $125,000 for separate returns. These are MAGI thresholds, not the long-term gains-rate brackets.

The calculator estimates the portion of this sale’s modeled gain that exceeds the threshold when added to the entered MAGI before the sale. It does not fully model other investment income, allowable NIIT deductions or Schedule D interactions. If your full return is complex, use the official IRS worksheets and a qualified professional.

Capital gains tax on stocks, funds, crypto and property

Ordinary sales of shares and investment funds generally fit the basic sale-minus-adjusted-basis approach. Cryptocurrency disposals may produce capital gains or losses depending on facts and reporting rules. But certain assets—including collectibles, unrecaptured Section 1250 gain on real property, some small-business stock and personal-residence sales—have special rules that the calculator deliberately does not implement. Do not use this general result as an authoritative real-estate or collectibles tax estimate.

How capital losses affect your estimate

Capital losses can offset gains, but U.S. tax law has ordering rules for short-term and long-term netting, loss carryovers and limits on ordinary-income deductions. The optional loss-offset field here simply reduces this sale’s gain for a what-if scenario. It is not a full Schedule D calculator and should not be taken as a determination that every loss entered is legally usable against this gain.

Does the calculator include state capital gains tax?

State rules vary. Some states tax gains through ordinary income-tax rules, while others apply special treatment; residence, apportionment, exemptions and local taxes can matter. Instead of inventing a single “state capital gains rate,” this tool offers an optional user-entered state effective percentage applied to the modeled taxable gain. The default is 0%, and the result identifies the state component separately.

2026 capital gains tax examples

Scenario Modeled gain Regular federal calculation
Single; $60,000 other taxable income; long-term $10,000 gain $10,000 $1,500 (entire gain at 15%)
Single; $40,000 other taxable income; long-term $20,000 gain $20,000 $1,582.50 (crosses 0% to 15%)
Single; $60,000 other taxable income; short-term $10,000 gain $10,000 $2,200 (incremental ordinary tax at 22%)

These simplified examples exclude NIIT, state taxes, offsetting losses, special tax-rate assets and the many additional provisions that can affect a complete federal return.

To calculate trading profit before taxes, use our Stock Profit Calculator. Then use this calculator to model the potential 2026 federal tax treatment of a realized gain.

Common mistakes when calculating capital gains

  • Applying the capital gains rate to the entire sale price instead of the gain.
  • Using gross income instead of taxable income to locate the long-term gain bands.
  • Assuming every long-term dollar is taxed at one flat rate instead of allowing income to cross the 0%, 15% and 20% bands.
  • Confusing the 3.8% NIIT MAGI threshold with the long-term gains thresholds.
  • Ignoring qualifying purchase/sale costs or assuming every fee automatically adjusts basis.
  • Applying regular stock-sale rules to collectibles or special real estate situations.
  • Assuming the same capital-gains rules apply across all U.S. states.

Frequently asked questions

What is the capital gains tax rate in 2026?

Most net long-term gains are taxed federally at 0%, 15% or 20%, depending on filing status and taxable income. Short-term gains generally use ordinary income rates. NIIT and state taxes can apply separately.

How do I calculate capital gains tax?

Find the adjusted gain by subtracting your adjusted basis and qualifying selling costs from sale proceeds, then determine holding period and filing status. Long-term gains use the applicable 2026 preferential brackets; short-term gains are generally added to ordinary taxable income.

Is capital gains tax based on profit or sale price?

It generally applies to your recognized gain, not the entire sale proceeds. Tax basis adjustments and special circumstances can change the taxable amount.

Is there a 0% long-term capital gains tax bracket?

Yes. For 2026, the zero-rate ceiling is $49,450 for single filers and $98,900 for joint filers, among other filing-status thresholds. Your other taxable income uses the bracket space before your capital gain.

Are capital gains taxes different for short-term sales?

Yes. Gains on ordinary capital assets held one year or less are generally taxed at ordinary rates, not preferential long-term rates.

Does the capital gains calculator include NIIT?

It provides a simplified incremental 3.8% NIIT estimate when your entered MAGI and this gain cross the statutory filing-status threshold. It does not replace the complete Form 8960 calculation.

Can I deduct investment losses?

Capital losses can offset gains under IRS netting rules, but the exact offset depends on the character of gains/losses, carryforwards, wash sales and other rules. The loss field is a planning approximation rather than Schedule D tax preparation.

Does this tool estimate taxes on home sales?

It is not designed to calculate special home-sale exclusions or real-estate depreciation recapture. Those situations require a property-specific tax analysis.

Methodology and official sources

The 2026 preferential long-term capital gains ceilings and ordinary rate schedules are sourced from the IRS Revenue Procedure 2025-32. Holding-period guidance is based on IRS Tax Topic 409 and Publication 550. NIIT thresholds follow the IRS 2026 Publication 505 and Form 8960 guidance. The output is an educational simplified estimate, not federal or state tax advice or a completed tax return.