Home › Finance › Capital Gains Calculator

Capital Gains Calculator

Use this free capital gains calculator to work out the profit or loss on a share sale. Enter the buy price, the number of shares, the sell price, and the brokerage fees, and the tool finds your total gain or loss, the gain per share, the percentage return, and whether the holding period makes it a short-term or long-term gain.

Fees are charged on both the buy and the sell, so the amount you enter is applied to each leg of the trade. Leave the dates blank if you only want the gain figures.

Gain: $2,450.00
$24.50 per share · 48.76% return · Held 433 days (about 14 months) — long-term holding (held over a year).

Buy cost vs. sale proceeds

The bars compare what the shares cost you (including fees) with what you received when you sold them. The gap between the bars is your gain or loss.

$5,025 $7,475 Total cost Proceeds Gain $2,450

A gain held for more than a year is usually treated as long-term; a year or less is usually short-term. Tax rates differ, so check the rules where you file.

How it works

A capital gain is the profit you make when you sell an asset — shares, a fund, property, or anything else — for more than you paid for it. If you sell for less, you have a capital loss. The gain is not the difference between the two share prices alone: brokerage fees and commissions come out of your profit too, so the honest figure compares your total cost with your total proceeds. This calculator does that arithmetic for shares, and it also works out the gain per share, the percentage return, and how long you held the investment.

Each input has a clear job. The buy price is what you paid for one share, and the number of shares is how many you bought. Multiply them and you get the purchase cost before fees. The sell price is what you received for one share, and the same share count gives the sale proceeds before fees. Fees cover brokerage commission and trading charges on the deal; they are deducted once from the total, because they are a real cost of the trade even though they never appear in the share price. The buy and sell dates set your holding period, which matters because many tax systems treat gains on assets held for more than a year differently from gains on assets held for a year or less.

Total gain = (Sell price × Shares − Fees) − (Buy price × Shares + Fees)
Gain per share = Total gain ÷ Shares
Return % = Total gain ÷ Total cost × 100

The formula is best read in two halves. The left half is what you walked away with: the sale value of all your shares minus the fees you paid. The right half is what the investment cost you: the purchase value of all your shares plus the fees. Subtract the cost from the proceeds and the sign of the answer tells the story — positive is a gain, negative is a loss. Divide the total gain by the number of shares for the per-share figure, and divide it by the total cost and multiply by 100 for the percentage return, which lets you compare investments of different sizes fairly.

The holding period is shown in days and months, with a note on whether the gain is short-term or long-term. As a general rule, holding for more than twelve months counts as long-term and holding for twelve months or less counts as short-term, and long-term gains are often taxed at lower rates than short-term gains. The exact boundary and rates depend on where you file and on your income, so treat the note as a guide, not a ruling. This calculator finds the gain itself; it does not work out the tax on that gain. Once you know the gain, use a capital gains tax calculator to estimate the tax bill, and keep your trade confirmations so you can prove the buy price, the sell price, and the fees if you are ever asked.

A few traps are worth avoiding. First, do not forget fees: on a small trade, a $25 commission can turn a modest paper gain into a real loss. Second, remember that a percentage return on its own says nothing about time — a 50% gain in ten years is a poor result, while the same gain in one year is excellent, so always read the return next to the holding period.

Worked example

Suppose you bought 100 shares at $50 each in September 2025, paying $25 in brokerage fees, and sold all 100 shares in November 2026 at $75 each, paying another $25 in fees — enter $25 as the fee for each leg of the trade. What did you make?

Step 1: Work out the total cost. 100 shares × $50 = $5,000, plus $25 of fees, gives a total cost of $5,025.

Step 2: Work out the proceeds. 100 shares × $75 = $7,500, minus $25 of fees, gives net proceeds of $7,475.

Step 3: Subtract cost from proceeds. $7,475 − $5,025 = a total gain of $2,450. Per share that is $2,450 ÷ 100 = $24.50, and the percentage return is $2,450 ÷ $5,025 × 100 = 48.76%.

Step 4: Check the holding period. From 1 September 2025 to 8 November 2026 is about 14 months, so the gain is a long-term gain under the usual more-than-a-year rule. Enter the same figures in the calculator — buy $50, 100 shares, sell $75, fees $25, those two dates — and it returns exactly gain $2,450.00, $24.50 per share, 48.76% return, long-term. The next step, if you need it, is to take that $2,450 gain to a capital gains tax calculator to estimate the tax, rather than guessing it here.

FAQ

How do I calculate capital gains on shares?

Multiply the sell price by the number of shares and subtract fees to get your proceeds, then multiply the buy price by the shares and add fees to get your total cost. The gain is proceeds minus cost. Divide by the shares for the per-share gain, and divide by the total cost for the percentage return.

Do brokerage fees reduce my capital gain?

Yes. Fees and commissions are a cost of the trade, so they come off your gain. A trade that looks profitable on share prices alone can be a loss once fees are included, especially on small trades — always include them.

What is the difference between a short-term and a long-term gain?

It depends on how long you held the asset. As a general rule, holding for more than a year makes the gain long-term, and a year or less makes it short-term. Long-term gains are often taxed at lower rates, but the exact boundary and rates depend on where you file.

Does this calculator work out the tax on my gain?

No. This calculator works out the gain itself — the profit before tax. To estimate the tax, take the gain figure it gives you and enter it in a capital gains tax calculator, which applies the tax rates for your situation.

What if I sell at a loss?

The calculator shows a negative gain, which is a capital loss, along with the loss per share and the negative percentage return. A loss is not always purely bad news: in many tax systems it can offset gains on other investments and reduce the tax you owe.

Disclaimer: Results are estimates only, not financial advice. This calculator works out the gain on a sale; it does not work out the tax on that gain. Tax rules and rates vary by location and income — check the rules where you file or speak to a qualified adviser.