Skip to content

Capital Gains Tax Calculator 2026

Estimate tax on investment gains, including short-term/long-term treatment and NIIT exposure.

Last Updated: June 2026

$
$
$

Used to estimate whether your gain falls in the 0%, 15%, or 20% long-term bracket and whether NIIT applies.

Enter purchase price, sale price, holding period, filing status, and ordinary income, then calculate to see the capital gain, estimated federal tax, NIIT, and net profit.

Important Disclaimer

This calculator provides an educational estimate for planning and comparison only. It is not tax, legal, financial, medical, lending, insurance, payroll, compliance, or institutional advice and it is not an official determination. Rules, rates, eligibility, formulas, and source data can change or depend on facts not captured here. Verify the result against official sources and qualified professional guidance before filing, paying, diagnosing, borrowing, investing, hiring, or making a compliance-sensitive decision.

Professional Review Status

This YMYL page has internal methodology review, but no external credentialed professional review is recorded yet.

Internal methodology review only
Reliance status
Credentialed tax review required before professional reliance
Required credentials
CPA, Enrolled Agent, licensed tax professional
Review scope
tax formulas, jurisdiction assumptions, withholding language, filing-sensitive examples, and compliance caveats

Current reviewer: Iliyas Khan, Internal tax and sales-tax methodology reviewer.

This page is educational planning support. A named CPA, EA, or licensed tax professional should review the page before it is positioned as tax advice or used for filing decisions.

Tax credentialed review: professional reliance limit

This page is educational planning support. A named CPA, EA, or licensed tax professional should review the page before it is positioned as tax advice or used for filing decisions. Results should be treated as a preliminary estimate, not a filing instruction, diagnosis, product recommendation, eligibility decision, or compliance sign-off. Required professional review: CPA, Enrolled Agent, licensed tax professional. Source expectation: Review should cite current IRS, state revenue department, payroll-tax, or official tax authority sources where applicable.

Checked by Iliyas Khan

Capital Gains Tax Calculator 2026 is checked for formula labels, source links, and result limits.

Iliyas Khan, Chief Operating Officer. Updated June 2026. Scope: tax calculators.

Tax credentialed review: Named internal reviewer: Iliyas Khan, Chief Operating Officer. External credentialed professional review is still required before this page is treated as professional advice.

Internal tax and sales-tax methodology reviewer. Review scope: calculator assumptions, labels, source context, workflow clarity, and compliance-sensitive disclaimers.

Relevant review context: CalculatorWallah tax and sales-tax calculator workflow owner; Source-first review of IRS, state revenue, rate, and filing-sensitive references; Compliance-sensitive labels, assumptions, and user-facing disclaimer review.

Required professional credentials: CPA, Enrolled Agent, licensed tax professional. Scope: tax formulas, jurisdiction assumptions, withholding language, filing-sensitive examples, and compliance caveats.

This page is educational planning support. A named CPA, EA, or licensed tax professional should review the page before it is positioned as tax advice or used for filing decisions.

Sources & methodology · Review standards

How to Use This Calculator

  1. Step 1: Enter purchase and sale values

    Start with cost basis and sale proceeds so the calculator can estimate the raw gain before tax treatment is applied.

  2. Step 2: Choose short-term or long-term treatment

    Use the holding-period input carefully because the tax difference between short-term and long-term gains can be one of the biggest planning levers on the page.

  3. Step 3: Add filing status and ordinary income

    Ordinary income matters because it affects how much room is left in the lower long-term capital-gains brackets.

  4. Step 4: Review total tax and after-tax profit

    Use the result to compare sell-timing scenarios, not just to compute one isolated tax number.

How It Works (Step by Step)

The calculator measures gain as sale price minus purchase price, then applies different tax logic based on holding period. Short-term gains are estimated through ordinary-rate impact. Long-term gains are allocated across 0%, 15%, and 20% federal tiers based on your filing status and ordinary income.

It then estimates Net Investment Income Tax (NIIT) where income exceeds threshold levels, combines tax layers, and returns after-tax profit so you can compare strategies.

This structure makes it easier to test sell-timing scenarios before executing a taxable sale.

Capital Gains Tax Guide

What Is Capital Gains Tax?

Capital gains tax is the federal tax you may owe when you sell an investment for more than your tax basis. In practice, the biggest question is not just how large the gain is. It is how the gain is classified, what other income you already have, and whether extra layers like NIIT are part of the picture.

That is why a strong capital gains guide should read like planning support, not a tax slogan. A one-day timing difference, a high-income year, or a loss-harvesting opportunity can all change the after-tax result more than many investors expect.

Capital gains model assumptions

This calculator is an investment-sale planning worksheet, not a replacement for Form 8949, Schedule D, broker reporting, or lot-level tax software.

Tax year model
2026 federal planning estimate
The calculator uses federal filing status, ordinary income, sale proceeds, cost basis, holding period, and NIIT exposure.
Primary federal forms
Form 8949 and Schedule D
Broker forms, wash sales, basis adjustments, and capital loss carryovers can change the final return.
Best use case
Before-sale and after-sale tax scenario planning
Run separate estimates for each lot when basis, holding period, or loss harvesting differs.
Reviewed against IRS investment-income guidance in June 2026.

Formula Explained

The basic gain formula is straightforward: sale price minus cost basis equals capital gain. The harder part is the tax treatment. Short-term gains are generally taxed like ordinary income, while long-term gains usually fall into preferential federal tiers.

Then the calculator checks whether your ordinary income already uses part of those lower long-term brackets and whether NIIT should be layered on top. That combination is what turns a simple gain estimate into a more realistic after-tax planning tool.

Investment sale planning matrix

Use this matrix to decide which input or related calculator should be reviewed before a sale.

Planning factorCalculator treatmentReview before relying on it
Cost basisPurchase price plus basis adjustmentsAdd commissions, reinvested dividends, improvements, crypto fees, or other allowed basis adjustments before relying on the result.
Sale proceedsAmount realized after selling costsUse net proceeds when broker fees or transaction costs reduce the amount realized.
Holding periodShort-term or long-termAssets held more than one year may use long-term capital gains rates; one year or less is short-term.
Income stackingOrdinary income plus gainOrdinary income can move long-term gain into 0%, 15%, or 20% brackets and can trigger NIIT.
Losses/carryoversNot fully modeled hereUse the stock loss calculator for capital loss carryovers, wash-sale issues, and annual ordinary-income loss limits.

Basis, proceeds, and holding-period audit

The widget uses purchase price as a simplified cost basis and sale price as proceeds, but real Form 8949 reporting often needs a lot-level audit. Broker commissions, reinvested dividends, return of capital, wash-sale adjustments, crypto gas fees, inherited basis, gifts, employee stock compensation, and corporate actions can all change basis before the tax rate is even considered.

Holding period also deserves a separate check. The one-year line determines whether the sale is modeled as short-term or long-term, but official classification depends on acquisition and disposition dates, transaction type, and IRS holding-period rules. Use the calculator to compare scenarios before selling, then confirm the final lot details against broker records.

Examples

ScenarioTax TreatmentWhy It Matters
Sell before one-year holding periodGain is usually treated as short-termOften creates a materially higher tax cost
Sell after long-term holding period beginsGain may move into 0%, 15%, or 20% long-term treatmentUseful for timing decisions when the position is flexible
High-income taxpayer with investment incomeNIIT may apply on top of regular gain taxImportant because simple gain estimates often miss this extra layer

Real-Life Applications

  • Comparing whether to sell now or after the position becomes long-term.
  • Estimating how a stock sale affects a high-income tax year.
  • Reviewing after-tax proceeds before rebalancing a concentrated position.
  • Planning a sale alongside loss harvesting or year-end income management.

Common Mistakes

  • Ignoring the holding period and assuming every gain is taxed the same way.
  • Forgetting that ordinary income can push long-term gains into higher tiers.
  • Missing NIIT in high-income scenarios.
  • Using a simplified basis when actual basis adjustments may apply.

Tips & Best Practices

  • Run both short-term and long-term scenarios before a flexible sale decision.
  • Model the gain in the context of your full-year income, not by itself.
  • Check whether harvested losses or carryforwards can lower the federal result.
  • Use the after-tax profit number, not only the tax number, when comparing options.

To go deeper, pair this page with the Stock Loss Tax Calculator, the Federal Income Tax Calculator, and the Tax Refund Calculator if the sale is part of a wider annual tax strategy.

Short-term versus long-term gains planning

Capital-gains planning improves dramatically once you separate holding-period decisions from sale-price decisions. Many investors focus only on gain amount, but the timing of the sale can change the tax treatment materially. A calculator makes that visible. It helps you test whether waiting longer for long-term treatment changes the after-tax outcome enough to justify the additional market exposure and timing risk.

This does not mean the lowest tax option is always the best decision. Sometimes risk control, diversification, or liquidity needs matter more than waiting for a lower rate. The point of the calculator is to quantify the tradeoff so you are not making that judgment blindly. Once the after-tax numbers are clear, strategy becomes easier to discuss and defend.

Cost basis, offsets, and realistic after-tax comparisons

Cost basis is one of the most important inputs in any gains calculation. If basis is wrong, the rest of the output becomes unreliable. The same is true for offsets such as harvested losses or carryforwards. Strong use of this tool means confirming basis records, then comparing the gain estimate against your broader tax picture rather than treating it as an isolated number detached from the rest of the return.

For planning, it is often helpful to compare at least three sale scenarios: sell now, sell after a holding period change, and sell with partial loss offsets. That type of scenario work turns the calculator from a curiosity into a decision support tool. Instead of asking only how much tax applies, you can ask which sale path produces the strongest after-tax outcome for the overall portfolio plan.

Keep the research moving with Paycheck Calculator, Net Pay Calculator, Net Salary Calculator, and UK Salary Calculator.

Frequently Asked Questions

Short-term gains (held one year or less) are generally taxed at ordinary income-tax rates. Long-term gains usually receive preferential 0%, 15%, or 20% federal rates.

NIIT is the 3.8% Net Investment Income Tax that can apply when modified adjusted gross income exceeds statutory thresholds.

Yes. Your ordinary income can use up lower long-term gain brackets, pushing part of your gain into a higher long-term rate tier.

This page focuses on federal capital gains tax and NIIT. State capital gains treatment can differ and should be modeled separately.

Yes, investment losses can offset gains and in some cases offset a limited amount of ordinary income subject to IRS rules.

This simplified model uses purchase price as cost basis. Actual basis may include adjustments such as commissions, wash sales, and corporate actions.

Holding-period classification in this tool is a user input for planning. Official determination depends on IRS holding-period rules and transaction dates.

Use it for scenario planning only. Confirm final numbers through tax software, broker forms, and a qualified professional if needed.

Related Calculators

Related Guides

Sources & References

  1. 1.IRS - Capital Gains and Losses (Topic No. 409)(Accessed June 2026)
  2. 2.IRS - Net Investment Income Tax(Accessed June 2026)
  3. 3.IRS Rev. Proc. 2025-32 (2026 inflation-adjusted §1(h) amounts)(Accessed June 2026)
  4. 4.IRS Publication 550 - Investment Income and Expenses(Accessed June 2026)
  5. 5.IRS - About Form 8949, Sales and Other Dispositions of Capital Assets(Accessed June 2026)