Skip to content

Planning

Capital gains tax calculator

Estimate capital gain, federal and state tax, and net sale proceeds from cost basis, sale price, and your estimated tax rates—a starting point before filing or selling.

How this calculator works

Capital gains tax applies when you sell an asset for more than your cost basis—generally what you paid plus certain improvements, minus adjustments. This calculator estimates:

Capital gain = sale price − cost basis (when positive)

Federal tax = capital gain × federal rate

State tax = capital gain × state rate

Net proceeds = sale price − total tax

Enter cost basis, sale price, and estimated federal and state tax rates as percentages. The results show capital gain, tax breakdown, net proceeds after tax, and an effective tax rate on the sale (total tax divided by sale price).

This is a simplified planning model. It does not distinguish short-term versus long-term holdings, apply primary-home exclusions, model capital losses, net investment income tax, alternative minimum tax, or phase-outs of preferential rates. Enter rates that reflect your best estimate or adjust inputs for selling costs and exclusions manually.

Realized gains in taxable brokerage accounts, investment property, and business assets can all trigger capital gains tax, but rules differ by asset type and holding period. Use this calculator for a first-pass dollar estimate before selling or before comparing investment outcomes with the ROI calculator.

What affects the result

Four inputs drive the estimate:

  • Cost basis. Higher basis reduces taxable gain. Include purchase price and capital improvements where applicable; reduce for depreciation taken on rental property when recapture rules apply (not modeled here).
  • Sale price. A higher sale price increases gain and tax if basis is unchanged. Subtract commissions from sale price or add them to basis if you want net proceeds closer to cash in hand.
  • Federal rate. Long-term capital gains for qualifying assets often use 0%, 15%, or 20% brackets depending on taxable income. Short-term gains may be taxed at ordinary income rates up to 37%. Enter the rate you expect to apply.
  • State rate. States vary widely—some have no income tax, others tax gains as ordinary income. Enter 0% if your state does not tax capital gains or if you are estimating federal-only impact.

A loss (basis exceeds sale price) produces zero capital gain in this calculator. Loss harvesting, $3,000 annual deduction limits against ordinary income, and carryforwards require tax software or professional guidance beyond this tool.

Real-world examples

Brokerage stock sale. You bought shares for $10,000 (basis) and sell for $15,000. Capital gain is $5,000. At 15% federal and 5% state, estimated tax is $750 + $250 = $1,000, leaving $14,000 net before any selling fees. Compare with holding longer if a lower long-term rate applies.

Home sale above basis (non-primary). A rental converted to personal use or a second home sold for $400,000 with $250,000 basis creates $150,000 gain. At 15% federal and 9% state, tax might approach $36,000 before exclusions—primary residences may qualify for large exclusions not built into this calculator.

Small gain, low bracket. Basis $5,000, sale $5,500, 0% federal long-term rate, 0% state yields $500 gain and $0 tax in the estimate—useful for checking whether you expect to owe tax at all.

High-income long-term gain. $100,000 gain at 20% federal plus 3.8% net investment income tax might require entering 23.8% as the federal rate to approximate combined federal layers—this calculator does not add NIIT automatically.

Investment property with depreciation. Adjusted basis is often lower than original purchase price because depreciation reduced basis over time. Enter your adjusted basis from tax records; gain and depreciation recapture at ordinary rates may exceed what a flat rate entry shows.

Comparing keep vs. sell. If net proceeds after tax fund a down payment, pair this estimate with the rent vs. buy calculator or home affordability calculator for housing decisions. Update net worth after the sale to reflect cash and removed asset value.

Common mistakes

Using purchase price when adjusted basis differs. Stock splits, reinvested dividends, return of capital, and depreciation all change basis. Wrong basis misstates gain.

Applying long-term rates to short-term sales. Assets held one year or less often face ordinary income rates. Enter the higher rate if the sale is short-term.

Forgetting state tax on top of federal. Some planners estimate federal only and overlook a 5–13% state layer on the same gain.

Ignoring selling costs. Real estate commissions and transfer taxes reduce net cash even when gain is calculated on gross sale price. Adjust sale price or basis accordingly.

Assuming primary-home exclusion without qualifying. The $250,000 / $500,000 exclusion requires ownership and use tests. Investment properties do not qualify.

Not coordinating with other income. Capital gains can push you into higher brackets, affect Medicare premiums, or trigger NIIT. A flat rate entry may understate total tax impact.

Treating estimated tax as final liability. Actual tax depends on filing status, deductions, other gains and losses, and carryovers. This calculator is a scenario tool, not a tax return.

When to use this calculator

Use this calculator before selling investments or property when you want a rough sense of tax and net proceeds. It helps compare scenarios—different sale prices, basis after improvements, or state relocation—and connects investment returns to spendable cash after tax.

Switch to the ROI calculator for total return over a holding period without tax detail. Use the paycheck calculator for wage withholding context. Read net worth explained to see how asset sales change your balance sheet.

Consult a CPA or tax preparer for actual filings, loss netting, installment sales, qualified opportunity zones, and entity-level structures. Tax law changes frequently; verify rates and rules for your tax year.

Related calculators

FAQ

What is cost basis?

Cost basis is generally what you paid for an asset plus certain improvements and adjustments, minus items like depreciation recapture adjustments. It is the starting point for measuring gain or loss on sale.

How is capital gain calculated?

Capital gain is usually sale price minus cost basis when the result is positive. This calculator does not model losses, holding-period distinctions, or selling expenses unless you adjust inputs.

What federal rate should I use?

Long-term capital gains often use 0%, 15%, or 20% for qualifying assets depending on income. Short-term gains may be taxed as ordinary income. Enter the rate that best matches your situation.

Does every state tax capital gains?

No. Some states have no income tax; others tax gains as ordinary income or at preferential rates. Enter your estimated state rate or 0% if not applicable.

Are selling costs included?

Not automatically. Reduce sale price or increase basis if you want commissions and transfer fees reflected in the estimate.

Does this handle net investment income tax?

No. High-income taxpayers may owe an additional 3.8% net investment income tax. This calculator models only the federal and state rates you enter.

What about primary home exclusions?

Qualified homeowners may exclude up to $250,000 ($500,000 married filing jointly) of gain on a primary residence. This calculator does not apply those exclusions unless you adjust basis or sale price.

Can capital gain be negative?

Yes—a loss occurs when basis exceeds sale price. This calculator shows zero capital gain in that case and does not estimate loss deductions or carryforwards.