Capital Gains Tax Calculator

Estimate tax on an investment sale from cost basis, proceeds, and your capital-gains tax rate.

amount originally paid for the investment

amount received from the sale

combined federal long-term rate you expect to apply

Enter cost basis, sale proceeds, and a tax rate to see the estimated tax.

How this capital gains tax calculator works

A capital gains tax calculator estimates the tax on an investment sale from cost basis, sale proceeds, and a tax rate you supply. The headline is the estimated tax. Details show gross gain or loss, adjusted gain after fees, net proceeds, the combined rate, and return on investment.

There is no built-in short-term or long-term bracket table. You enter the capital-gains rate you expect to apply. Open Advanced for purchase fees, sale fees, and a state or local rate that stacks on the main rate. Closing Advanced opts those extras out even if the fields stay filled. For a percentage return without tax, use the stock return calculator.

How to use the capital gains tax calculator

  1. Choose a currency, then enter cost basis, sale proceeds, and the capital-gains tax rate as a percentage.
  2. Read the headline estimated tax. Gross gain, adjusted gain, net proceeds, combined rate, and ROI sit underneath.
  3. Open Advanced options only if you have purchase or sale commissions, or a state or local tax rate to add.
  4. Closing Advanced ignores fees and the state rate even if those fields stay filled.

Gain, loss, and the rate you type

Gross gain is sale proceeds minus cost basis. A negative figure is a loss. Tax is charged only on a positive adjusted gain: losses produce zero tax, but net proceeds and ROI are still shown. The rate can be 0% through 100%. Empty rate means no result, not a 0% estimate. The calculator does not decide whether a holding period is short-term or long-term.

Fees, state tax, and closing Advanced

Purchase fees and sale fees both reduce the gain before tax. Sale fees also come off net proceeds. A state or local rate is added to the capital-gains rate you typed; tax uses that combined rate. Closing Advanced treats fees and the state rate as unused (quantity of extras is zero) even if values stay typed.

Capital gains tax formulas

These are the same formulas the calculator uses. The tax rate is a percentage you enter, not a bracket looked up by income. Return on investment is the after-tax adjusted gain divided by cost basis plus purchase fees. Sale fees are not in that amount. If that amount is 0, the return is 0%.

Gross gain or loss
gross gain=proceeds−cost basis
Adjusted gain after fees
adjusted gain=gross gain−fees
Estimated capital gains tax
tax=max(0,adjusted gain×combined rate)
Return on investment after tax
ROI=adjusted gain−taxcost basis+purchase fees

Worked examples

Example: USD 10,000 basis, USD 15,000 proceeds, 15% tax

Gross gain is 15,000 − 10,000 = USD 5,000. With no fees, tax is 5,000 × 15% = USD 750. Net proceeds are 15,000 − 750 = USD 14,250. ROI is (5,000 − 750) ÷ 10,000 = 42.50%.

Example: same sale with USD 100 purchase fees, USD 200 sale fees, 5% state tax

Adjusted gain is 5,000 − 100 − 200 = USD 4,700. Combined rate is 15% + 5% = 20%. Tax is 4,700 × 20% = USD 940. Net proceeds are 15,000 − 200 − 940 = USD 13,860. ROI is (4,700 − 940) ÷ (10,000 + 100) = 37.23%. Close Advanced and fees and the state rate drop out of the result.

Example: USD 15,000 basis, USD 10,000 proceeds, 15% tax

Gross gain is −USD 5,000. Tax is max(0, −5,000 × 15%) = USD 0. Net proceeds are USD 10,000. ROI is (−5,000 − 0) ÷ 15,000 = −33.33%. A loss does not produce a tax credit on this page.

Things to keep in mind

This is an estimate, not tax advice or a filing tool. It does not apply wash-sale rules, exemptions, stepped-up basis, or a country’s capital-gains schedule. Amounts are shown as an ISO currency code, then the number (USD 750). Purchase fees reduce the gain and are included in the amount the return divides by. Only sale fees reduce net proceeds.

Capital gains tax calculator FAQ

Does this calculator use short-term and long-term rates?

No. You type a single capital-gains rate. Use the long-term rate that applies to you, or a short-term ordinary-income rate, whichever matches the sale. There is no income-bracket table.

How do purchase and sale fees affect the tax?

Open Advanced and enter them. Both fees reduce the gain before tax. The return divides by cost basis plus the purchase fees. Sale fees also come off net proceeds, and they are not part of that amount. Closing Advanced drops fees from the result even if the fields stay filled.

What if I sold at a loss?

The calculator still shows the loss, net proceeds, and ROI. Estimated tax is USD 0. It does not compute a capital-loss carryover or an offset against other income.

Can I add a state capital-gains tax?

Yes. Open Advanced and enter a state or local rate. It is added to the main rate, and tax uses the combined percentage. Closing Advanced opts that extra rate out.

Does closing Advanced still use fees and the state rate?

No. Closing Advanced opts those extras out even if the fields stay filled. Open Advanced again to put them back in the result.

Does this capital gains tax calculator store my numbers?

Completed results can be saved in this browser’s local history so you can reopen them later. They stay on your device and are not sent to our servers or to analytics.