💰 Financial Calculators › Investment & Wealth

Capital Gains Tax Calculator (2026 LTCG, STCG & NIIT)

Estimate the 2026 federal tax on an investment profit — long-term gains at 0/15/20%, short-term gains as ordinary income, plus the 3.8% Net Investment Income Tax — and see what you keep after tax.

Capital Gains Tax — interactive calculator, computed instantly in your browser.

📚 Authoritative Educational Guide

2026 Capital Gains Tax: Long-Term, Short-Term, and the NIIT

Capital gains tax applies to profit from selling an asset — stocks, bonds, real estate, crypto — for more than you paid. The rate depends almost entirely on how long you held it and your taxable income. Assets held one year or less are short-term and taxed as ordinary income; assets held more than a year qualify for the lower long-term schedule.

1. Long-Term vs Short-Term: The One-Year Line

The holding period is the single biggest lever on your tax bill. Short-term gains (held ≤ 1 year) stack on top of ordinary income and can reach 37%. Long-term gains (held > 1 year) use a separate 0/15/20% schedule that never exceeds 20% before the NIIT.

\text{Gain} = \text{Sale Price} - \text{Cost Basis} - \text{Selling Fees}
  • Cost basis is what you paid for the asset, adjusted for splits, dividends reinvested, and improvements (for property).
  • Wash-sale rule: buying a "substantially identical" asset within 30 days before or after a loss sale disallows the deduction.

2. The 3.8% Net Investment Income Tax (NIIT)

On top of the capital gains rate, high earners pay the NIIT on the lesser of net investment income or modified adjusted gross income (MAGI) above a threshold: $200,000 single, $250,000 joint, $125,000 married filing separately. It applies to gains, dividends, interest, rental income, and non-qualified annuity income — but not wages or self-employment income.

\text{NIIT} = 3.8\% \times \min(\text{Net Investment Income},\ \text{MAGI} - \text{Threshold})

A single filer with $250,000 MAGI and $60,000 in gains pays the 3.8% on $50,000 (the amount MAGI exceeds $200,000), not the full gain — the tax is capped by whichever is smaller.

3. Worked Example: $20,000 Long-Term Gain, $80,000 Other Income

A single filer with $80,000 of ordinary taxable income realizes a $20,000 long-term gain. The gain stacks above the ordinary income:

  1. $80,000 sits in the 15% LTCG band (above $49,450), so the first slice fills to the top of the 15% range.
  2. The portion crossing $545,500 would hit 20%, but this example stays well below.
  3. With MAGI at $100,000 (below the $200k threshold), no NIIT applies.

The calculator shows the slice-by-slice result, effective rate on the gain, and any NIIT. For the trade-level break-even including broker fees, pair it with the 📈 Stock Profit Calculator.

4. Harvesting Losses and Timing Realizations

Because only realized (sold) gains are taxed, timing matters. Tax-loss harvesting sells losing positions to offset gains — up to $3,000 of excess loss offsets ordinary income each year, with the rest carried forward. Spreading large realizations across tax years, donating appreciated stock, and holding past the one-year line are common ways to lower the bill.

  • Netting: short-term losses offset short-term gains first; long-term losses offset long-term gains first; then the two nets combine.
  • Retirement accounts: gains inside a 401(k) or IRA are not taxed until withdrawal, so the capital gains schedule never applies to those positions.

🔗 Investing & Tax Cross-References

Gains rarely arrive in isolation — grade any buy/sell trade down to the break-even price with the 📈 Stock Profit Calculator, then compare after-tax returns inside the 💰 Financial Hub.

Taxable brokerage sales compete with sheltered accounts — weigh the bite against 🏖️ Retirement and track recurring dividend income with the 💰 Dividend Calculator.

Frequently Asked Questions (Capital Gains Tax)

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

Long-term capital gains come from assets held more than one year and are taxed at 0%, 15%, or 20% depending on income. Short-term gains come from assets held one year or less and are taxed as ordinary income at your marginal rate, which can reach 37%. Holding past the one-year line is the main way investors reduce the rate.

What is the Net Investment Income Tax and do I owe it?

The NIIT is an additional 3.8% tax on the lesser of your net investment income or your modified adjusted gross income above a threshold — $200,000 single, $250,000 joint, $125,000 married filing separately. It applies to capital gains, dividends, interest, and rental income, but not wages or self-employment income.

How is cost basis calculated and why does it matter?

Cost basis is what you paid for an asset, adjusted for stock splits, reinvested dividends, and (for real estate) capital improvements. It is subtracted from the sale price to find the taxable gain. A higher basis means a smaller gain, so keeping accurate purchase records directly lowers your tax.

Can capital losses offset my regular income?

Yes, up to a limit. Capital losses first offset capital gains of the same type. If losses exceed gains, up to $3,000 of the excess can offset ordinary income each year ($1,500 if married filing separately), and any remaining loss carries forward to future tax years indefinitely.

Does selling at a profit inside a retirement account trigger capital gains tax?

No. Gains inside a 401(k), IRA, or other tax-advantaged account grow tax-deferred (or tax-free in a Roth) and are not subject to the capital gains schedule. Capital gains tax applies only to sales in taxable brokerage accounts and other non-retirement assets.