Skip to main content
capitalgaintaxcalc.com

How the math works

Capital gains calculator methodology

Updated 2026-08-18 · Educational only — not tax advice

8 layers

From holding period to after-tax proceeds

50 states

Cited state revenue sources on each page

2025–2026

Federal brackets from Rev. Proc. 2025-32

What this page covers

The calculator estimates US capital gains tax for a sale you enter: stocks, crypto, real estate, collectibles, and related planning cases. Federal long-term and ordinary brackets for tax year 2026 followIRS Revenue Procedure 2025-32. Holding-period rules followIRS Topic 409. State tax uses a cited model for each of the 50 states.

Results are planning estimates — not a filed return and not a substitute for a CPA. Use this page to see the eight calculation layers, primary sources, and where the model is simplified on purpose.

Engine

Eight calculation layers

  1. Holding period

    Day count from buy to sell classifies short-term vs long-term and flags the 30-day cliff when you are close to one year.

    Short-term vs long-term →
  2. Raw gain or loss

    Sale proceeds minus adjusted basis minus selling costs. Unrealised paper gains are not taxed until you sell.

    How we calculate gain →
  3. Asset-class rules

    Collectibles can use a 28% long-term federal ceiling. Primary homes may use Section 121. Real estate can include depreciation concepts. QSBS has Section 1202 hooks.

    Collectibles and gold →
  4. Federal tax

    Short-term gains use ordinary brackets. Most long-term gains use 0%, 15%, or 20% with stacking on other taxable income.

    2026 federal rates →
  5. NIIT

    An extra 3.8% Net Investment Income Tax can apply when MAGI exceeds $200,000 (single), $250,000 (joint), or $125,000 (married filing separately).

    NIIT 3.8% →
  6. State tax

    Zero, flat, graduated, or special-rule models — including Washington, North Dakota, and Montana — each with a cited state source.

    All 50 state calculators →
  7. Optimisation hints

    Planning tips such as waiting for long-term treatment, wash-sale warnings on securities, and harvest context in a taxable account.

    Tax-loss harvesting →
  8. Output

    Federal tax, NIIT, state tax, total tax, effective rate, and after-tax proceeds for the sale you entered.

    Open the calculator →

Primary sources

Known limits

  • Graduated states

    Many graduated-rate states apply the top modeled rate to taxable gains. Your actual marginal state rate may be lower.

  • Massachusetts

    Modeled as a 5% flat state rate in this calculator — not a short-term vs long-term split.

  • Washington

    The long-term capital-gains surtax uses the $262,000 threshold encoded in our data. Confirm the current-year statute before filing.

  • California MHST

    Estimates do not include the 1% Mental Health Services Tax.

  • Lots and crypto

    The engine is strongest on a single sale (or a small order log). Multi-wallet crypto lots are approximate.

  • 1031 and equity comp

    A completed 1031 exchange is not fully modeled. RSU/option wage income at vest or exercise is separate from the later capital-gain sale leg.

How we update the model

When IRS revenue procedures or state statutes change, we update federal bracket tables and state rate models, extend automated tests, and redeploy the static site. Last content pass on this page:2026-08-18.

Simplified graduated-state modeling, single-lot crypto estimates, and approximate depreciation inputs are documented limits — not hidden rounding. If you spot a rate that no longer matches an official source, contact us.

FAQ

Methodology questions

Is this calculator tax advice?

No. Results are educational estimates for planning. They are not a filed return, not CPA advice, and not a substitute for Form 8949, Schedule D, or professional software.

Which IRS sources do the 2026 brackets follow?

Federal ordinary and long-term capital gains thresholds for tax year 2026 follow IRS Revenue Procedure 2025-32. Holding-period basics follow IRS Topic 409. NIIT follows IRC Section 1411 and Form 8960.

Why can a graduated state look high?

For many graduated-rate states the model applies the top encoded rate to taxable gains. Your actual marginal state rate can be lower if the gain sits in lower brackets.

Does California include the 1% Mental Health Services Tax?

No. California estimates in this calculator do not include the 1% MHST. Confirm current Franchise Tax Board rules before filing.

Guides