How to use the capital gains tax calculator
- Enter your cost basis — the total you paid, including purchase price and fees.
- Enter the sale proceeds — what you received after selling.
- Enter the holding period in years. One year or more counts as long-term.
- Enter your short-term and long-term tax rates as percentages.
- Read the gain, the rate applied, the tax owed and your after-tax profit.
Worked example
You buy an asset for $10,000 and sell it 2 years later for $15,000. The gain is $5,000. Because you held it over a year, the 15% long-term rate applies, so the tax is $750 and your after-tax profit is $4,250.
The math
gain = sale proceeds - cost basis
long-term if holding >= 1 year, else short-term
rate = long-term rate if long-term else short-term rate
tax = gain x rate% / 100 (only if gain > 0)
after-tax profit = gain - tax
This uses the US distinction between short-term gains (taxed as ordinary income) and long-term gains (taxed at lower rates). Your actual rate depends on your income bracket and country rules.