capitals gain tax calculator

Estimate Your Capital Gains Tax

Use this calculator to estimate U.S. federal capital gains tax, optional Net Investment Income Tax (NIIT), and optional state tax.

For educational use only. Tax rules change, and this tool is not tax advice.

If you’ve ever sold stock, crypto, real estate, or a business asset, you know the tax part can be surprisingly complex. A good capitals gain tax calculator helps you answer one essential question: how much of my profit will I actually keep?

How this capitals gain tax calculator works

This tool estimates your taxable gain and then applies tax logic based on your holding period and filing status.

  • Step 1: It calculates your net gain using sale price, adjusted basis, and selling costs.
  • Step 2: It checks whether your gain is short-term or long-term.
  • Step 3: It estimates federal tax using current-style bracket structures.
  • Step 4: It optionally estimates NIIT and state-level tax.

Core formula

Capital Gain = (Sale Price − Selling Costs) − (Purchase Price + Capital Improvements)

This gives you a rough estimate of gain before special exclusions, wash-sale rules, depreciation recapture, and other advanced tax adjustments.

Short-term vs long-term capital gains

The holding period often has the biggest impact on your tax bill:

  • Short-term gain: Asset held 12 months or less. Usually taxed at ordinary income rates.
  • Long-term gain: Asset held more than 12 months. Often taxed at 0%, 15%, or 20% federally depending on income.

Because of this, the difference between selling at month 11 versus month 13 can materially change your after-tax proceeds.

Inputs that most affect your result

1) Cost basis and improvements

Many people understate basis. If you paid for qualifying capital improvements, those costs can increase basis and reduce taxable gain.

2) Selling costs

Commissions, legal fees, transfer taxes, and some closing costs can reduce proceeds and therefore reduce gain.

3) Income stacking

Long-term capital gains rates are influenced by your taxable income. Even if gains have preferred rates, your regular income can push portions of your gain into higher brackets.

4) NIIT and state tax

High-income households may owe the 3.8% NIIT. On top of that, many states tax gains as ordinary income, creating a meaningful second layer of tax.

Important: This calculator provides estimates only. It does not include every IRS rule or every state-specific exception.

Common planning ideas to reduce capital gains tax

  • Hold longer when possible to move from short-term to long-term treatment.
  • Tax-loss harvest by realizing losses to offset gains where appropriate.
  • Spread sales across years to avoid bunching income into higher brackets.
  • Track basis carefully, including reinvestments and capital improvements.
  • Coordinate with charitable giving strategies for appreciated assets.

Example scenarios

Example A: Short-term stock sale

You buy shares for $20,000 and sell for $27,000 in 8 months, with $100 in fees. If your ordinary taxable income is already high, much of the $6,900 gain may be taxed at your top marginal rate.

Example B: Long-term real estate investment

You buy for $250,000, invest $30,000 in improvements, and sell for $420,000 with $25,000 in selling costs after 3 years. The adjusted basis and holding period can significantly lower your effective tax rate versus short-term treatment.

Frequently asked questions

Does this include depreciation recapture?

No. Depreciation recapture can materially change real estate tax outcomes and usually requires a deeper calculation.

Does this calculator include the home sale exclusion?

No. Primary residence exclusion rules (for example, potential exclusion up to statutory limits if tests are met) are not automatically applied here.

Can this replace tax software or a CPA?

No. Use this tool for planning and rough budgeting. For filing decisions, rely on tax software and professional advice.

Bottom line

A capitals gain tax calculator is one of the fastest ways to test “sell now vs sell later” decisions. Even simple estimates can reveal whether timing, basis tracking, and tax-aware planning could save you thousands.

🔗 Related Calculators

🔗 Related Calculators