stocktax.tools

Capital Gains Tax Calculator

Estimate the tax on a U.S. stock sale — short-term vs long-term, federal plus state — and see your after-tax profit, net proceeds and effective rate.

%
Short-term gains are taxed as ordinary income — use your top bracket.
%
Estimated total tax
Capital gain
After-tax profit
Effective tax rate
Net proceeds
You keep Tax
Estimate for U.S. stocks. Ignores 3.8% NIIT, loss carryovers and other rules.

How to use it

  1. Enter your buy price, sell price and number of shares.
  2. Choose long-term (held over a year) or short-term (a year or less).
  3. For long-term, pick the federal rate (0/15/20%); for short-term, enter your marginal income rate.
  4. Add an optional state rate and read your estimated tax and after-tax profit.

How the tax is estimated

Your capital gain is the sale value minus what you paid. Long-term gains (assets held over a year) get preferential U.S. federal rates of 0%, 15% or 20%; short-term gains are taxed at your ordinary income rate.

A capital loss (selling below cost) means no gain to tax, and may offset other gains — see a tax professional.

Related calculators

  • RSU Tax Calculator — Vesting tax, your real cost basis and the withholding gap you may owe.
  • ESPP Tax Calculator — Qualifying vs disqualifying disposition, the 15% discount and after-tax profit.
  • ISO AMT Calculator — The bargain element, the AMT trap on exercise-and-hold and qualifying sales.
  • NSO Tax Calculator — Ordinary income and FICA at exercise, the withholding gap and cost basis.

Embed this calculator

Free to add to your website — copy & paste this code:

Frequently asked questions

Short-term vs long-term — what's the difference?

Assets held one year or less are short-term, taxed as ordinary income (up to 37%). Hold more than a year and the gain is long-term, taxed at preferential federal rates of 0%, 15% or 20%.

Which long-term rate applies to me?

It depends on your taxable income for the year — roughly 0% at low incomes, 15% in the middle, 20% for high earners. Check IRS Rev. Proc. for current-year thresholds.

Does this include NIIT or state tax?

State tax is an optional input. The 3.8% net investment income tax (NIIT) on high earners is not modeled. This is a simplified estimate.

I have RSUs — is the cost basis the same as stock I bought?

No — for RSUs, your cost basis is the Fair Market Value on the vest date, not $0. If you use the wrong basis you will overpay. Use the <a href="/rsu/">RSU Tax Calculator</a> instead.

I'm a non-resident alien — do I owe U.S. capital gains tax?

Generally no — NRAs are not taxed on U.S. stock capital gains. You may owe 30% withholding on dividends (reduced by treaty), which you can reclaim or reduce by filing W-8BEN with your broker.

What if I sold at a loss?

No gain means no capital gains tax. The loss can offset other capital gains, and up to $3,000/year can offset ordinary income. Excess losses carry forward.

⚠️ Educational estimate only — NOT tax advice. Tax depends on your full situation, income, residency and current law. Consult a qualified tax professional before acting.