Skip to main content

Capital Gains Tax Calculator

Estimate your U.S. federal, state, and Net Investment Income Tax (NIIT) on a capital gain and see what you may keep after tax.

1. Enter your sale details

+ More tax options
%
Estimated total tax on gain
$4,350.00
Net capital gain$29,000.00
Federal tax on gain$4,350.00
State tax on gain$0.00
NIIT$0.00
After-tax gain$24,650.00
Effective tax rate on gain15.00%

Tax vs. after-tax gain

Tax versus after-tax gain A donut chart showing estimated tax and the gain remaining after tax. 15.00% tax rate
Tax $4,350.00 After-tax gain $24,650.00
Your estimated long-term gain has exposure to the 15% federal capital-gains rate under these inputs.

Federal thresholds use the 2026 tax-year framework configured in this calculator. State rates are user-entered.

Formula

Tax basis = Purchase price + Capital improvements
Net gain = Sale price − Selling costs − Tax basis
Long-term federal tax = Gain stacked above taxable income at applicable 0%, 15%, and 20% thresholds.
Short-term federal tax = Ordinary tax after gain − Ordinary tax before gain.

Worked example

With a $50,000 purchase, $80,000 sale, $1,000 selling costs, and $75,000 of taxable income before the gain, the net gain is $29,000. For a single filer holding the asset long-term, the estimated federal tax is $4,350.00 and the after-tax gain is $24,650.00.

About this calculator

This estimator applies the federal tax brackets and long-term capital-gain thresholds configured for the 2026 tax year. It can also estimate state tax and NIIT when enabled. It does not model every special tax rule, such as collectibles, unrecaptured §1250 gain, qualified small-business stock, AMT, credits, wash-sale adjustments, or detailed capital-loss carryovers.

How to use

  1. Enter the asset's purchase price, eligible capital improvements, sale price, and selling costs.
  2. Choose long-term or short-term treatment and enter taxable income before the gain.
  3. Open More tax options to select filing status or add optional NIIT and state tax estimates.
  4. Review federal tax, total tax, effective rate, and after-tax gain.

Why use it?

It helps estimate how much of an investment sale profit may be consumed by federal and optional state or NIIT taxes before making a transaction decision.

Important terms

  • Tax basis: Generally your cost in the asset, adjusted for eligible items such as capital improvements.
  • Long-term gain: Generally a gain on an asset held more than one year.
  • Short-term gain: Generally a gain on an asset held one year or less and generally taxed as ordinary income.
  • NIIT: An additional 3.8% tax that can apply to certain net investment income above applicable MAGI thresholds.

FAQ

How are long-term gains taxed?
Most net long-term gains use 0%, 15%, or 20% federal rates depending on taxable income and filing status.
How are short-term gains taxed?
Short-term gains are generally taxed as ordinary income, so this calculator estimates the incremental federal tax created by adding the gain to taxable income.
When can NIIT apply?
NIIT is generally 3.8% of the lesser of applicable net investment income or MAGI above the threshold: $200,000 for single or head-of-household filers, $250,000 for married filing jointly, and $125,000 for married filing separately.
Does this include state tax?
Yes, but only when enabled. Enter your applicable state tax rate because state rules vary significantly.
What happens if I have a capital loss?
The calculator estimates the federal tax benefit from the annual capital-loss deduction limit. Actual results can differ because other capital gains, losses, and carryovers may affect the deduction.
Tax disclaimer: Results are estimates for educational and planning purposes only and do not constitute tax, legal, or financial advice. Actual liability can differ because of deductions, credits, special asset rules, capital-loss carryovers, depreciation recapture, other investment income, and other tax items. Consult a qualified tax professional for filing or transaction decisions.
✓ Copied to Clipboard!