A capital gain is the profit when you sell an asset for more than you paid: (sell − buy) × quantity. If you sell for less, it's a capital loss. This calculator gives the gain or loss, the tax owed at the rate you enter, your net proceeds after tax, and the return percentage — a quick read on what a sale actually nets you.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the gain/tax formula, recomputed in code. Informational estimate, not tax advice.
The capital gains formulas
The buy price is your cost basis. Subtract it from the sell price and multiply by how many units you sold to get the gain. Tax applies only to gains — a loss is not taxed (and often offsets other gains). Net proceeds are the gain after tax, and the return percentage compares the price change to what you paid, independent of quantity.
Worked example — 100 shares
Scenario: buy 100 shares at $50, sell at $80, long-term rate 15%.
The sale produces a $3,000 gain. At a 15% long-term rate the tax is $450, leaving $2,550 net — a 60% return on the original price. Had you instead bought 50 units at $100 and sold at $75, that's a $1,250 loss with no tax due, which in many systems could offset other gains.
Frequently Asked Questions
(sell − buy) × quantity. 100 shares bought at $50, sold at $80 → (80−50)×100 = $3,000 gain.
Gain × your rate, only on gains. $3,000 at 15% = $450 tax, $2,550 net. Losses aren't taxed.
Assets held past a set period (a year in the US) are often taxed lower. Enter the rate that fits your holding period.
No tax on the sale. A loss often offsets other gains or some income — check your local rules.
No — it's an estimate with one rate. Real tax involves brackets, allowances and country rules. Consult a professional.