Finance education, free and open.An independent learning project
THEFINANCE ARCHIVES
Finance foundationsEquitiesFixed incomeDerivativesEconomicsFinancial statementsPortfolio management
Home / Finance foundations / Capital Gain and How to Measure a Rise Above Cost
Finance foundations

Capital Gain and How to Measure a Rise Above Cost

Learn to calculate a capital gain from cost basis and sale proceeds, see when a paper gain becomes realised, and understand where trading fees fit in.

In this chapter

Beginner

You buy a share for $25.00 and later see it trading at $32.00. You have a capital gain of $7.00 per share before fees. If you still own the share, the gain is unrealised, or on paper. A sale at that price turns the increase on the share you sold into a realised gain.

Find the cost of the units you are measuring

Your cost basis is the recorded cost assigned to the asset. For a straightforward purchase in this chapter, it is the purchase price of the units plus any stated buying fee. For a sale, net sale proceeds are the sale amount left after the stated selling costs.

\[ G=X-B \]

\(G\) is the signed capital gain or loss in USD. \(B\) is the cost basis of the units involved. \(X\) is their net sale proceeds if you sell, or their stated market value if you are marking a position you still hold. A positive \(G\) is the amount of the capital gain. A negative result measures a capital loss.

Worked example. Twelve shares rise in value, then you sell

You buy 12 shares on 3 February 2026 at $25.00 each and pay a $6.00 buying fee. On 2 June the shares are quoted at $32.00 each. You sell them all on 3 June at the same price and pay a $4.00 selling fee. All amounts are in USD. The June quote is a market value before an exit fee. Assume no distributions, extra purchases or taxes.

Date and eventHow the amount is measuredAmount (USD)
3 February, shares bought12 × $25.00 plus $6.00 buying fee$306.00 cost basis
2 June, shares still held12 × $32.00 quoted market value$384.00 market value
3 June, all 12 shares sold12 × $32.00 less $4.00 selling fee$380.00 net sale proceeds

On 2 June the paper gain is \(384-306=\$78.00\). The quote could move before the order fills. On 3 June the net sale proceeds give a realised gain of \(380-306=\$74.00\). The share price stayed at $32.00 between the two observations. The $4.00 difference between these two gain figures comes from the selling fee.

A sale of some shares uses only their basis

For one purchase lot, you can split the total cost across the shares bought together. Here each share carries \(306/12=\$25.50\) of basis. If you sell only four of those shares, use $102.00 of basis for that sale. The other eight shares keep the rest of the basis.

When you buy on several dates, you may have several purchase lots at different costs. First establish which units the sale is measured against, then apply their basis. Cash dividends belong to the investment’s income. The calculation above tracks what happened to the capital in the shares. Both income and changes in the value of the shares contribute to total return.

Worked example. Sell shares from one of two purchase lots

On 2 February 2026 you buy ten shares at $18.00 each and pay a $4.00 buying fee. On 4 May you buy six more at $24.00 each and pay a $3.00 buying fee. On 10 August the shares trade at $30.00. You sell four shares that the broker identifies as coming from the February lot and pay a $2.00 fee on that sale. All amounts are in USD. Assume zero taxes and dividends, and mark the shares still held at the market quote before any future selling costs.

LotOriginal cost basis (USD)Basis per share (USD)Shares soldCost basis still held (USD)
February purchase, ten shares$184.00$18.404$110.40
May purchase, six shares$147.00$24.500$147.00

The four shares bring in \(4\times\$30.00-\$2.00=\$118.00\) in net proceeds. The cost assigned to those four shares is \(4\times\$18.40=\$73.60\). Your realised gain is $44.40. The total originally paid for the February lot matters because it sets the basis per share. The sale uses only the portion attached to the shares you sold.

You still own twelve shares worth $360.00. Their combined basis is $257.40. The remaining $102.60 is an unrealised gain. Add that to the realised gain and you can reconcile the whole position at this point. You started with $331.00 of purchase cost, and you now have $118.00 of sale cash plus $360.00 of shares, a difference of $147.00.

If the sale had used four May shares instead, those shares would have carried $98.00 of basis and realised a $20.00 gain. The same proceeds can realise a different gain when the cost of the units sold differs. Use the lot identified for the sale and the relevant basis convention.

Practice questions

Amounts are in USD. Use the fee treatment shown in the chapter. Ignore taxes and income unless specified.

1. Profit on a sale with two fees

You buy 10 shares at $18.00 each and pay a $5.00 buying fee. You sell them later at $22.00 each and pay a $3.00 selling fee. What is the realised capital gain?

Question 1 choices

A is correct

  • A. The basis is $185.00 and the net sale proceeds are $217.00. The difference is $32.00.
  • B. $35.00 deducts the buying fee but uses the gross sale value. The sale also cost $3.00.
  • C. $40.00 is the change in share prices times 10. Both fees reduce the amount gained.

2. The broker shows a new market value

A position with a cost basis of $400.00 has a market value of $460.00 today. You still hold it and the quote excludes selling costs. How do you describe the $60.00?

Question 2 choices

C is correct

  • A. The $60.00 is measured using a quote. A sale would establish the actual proceeds.
  • B. The amount comes from the position’s change in value. Investment income is a payment such as a dividend or interest.
  • C. $460.00 minus $400.00 gives a $60.00 gain on paper while the position is still held.

3. Selling part of one lot

You buy 20 shares as one lot for a total cost basis of $500.00. You sell six of them for net proceeds of $180.00. What is the realised gain on those six shares?

Question 3 choices

B is correct

  • A. $180.00 is all the net cash from the sale. Part of that recovers the cost of the six shares.
  • B. Each share has $25.00 of basis. Six shares carry $150.00, giving a gain of $30.00.
  • C. Subtracting the whole $500.00 uses the cost of 20 shares. The sale covers only six.

4. Dividends and a gain

Your shares cost $250.00. During the holding period you receive $12.00 in dividends. You then sell the shares for net proceeds of $280.00. What is the realised capital gain?

Question 4 choices

A is correct

  • A. Capital gain comes from the sale proceeds less basis, \(280-250=\$30.00\).
  • B. $42.00 combines the $30.00 gain on the sale and the $12.00 dividend.
  • C. Subtracting the dividend treats the income payment as a selling cost. The stated net proceeds already give the amount from the sale.

5. The price you actually sell at

A share you bought for $40.00 is quoted at $55.00 one day. A week later you sell for $52.00. There are no fees. What is your realised capital gain?

Question 5 choices

B is correct

  • A. $15.00 was the paper gain at the earlier quote of $55.00.
  • B. The sale brought in $52.00 against a $40.00 basis, giving $12.00 of realised gain.
  • C. $3.00 is the fall from the earlier quote to the sale price. The gain is measured from the purchase basis.

6. Gain on the sold lot and the shares still held

You buy five shares at $12.00 each and later buy five more at $18.00 each. At a quote of $20.00, you sell all five shares from the second lot for that price. Assume zero fees. What are the realised gain and the remaining unrealised gain, respectively?

Question 6 choices

C is correct

  • A. This treats both lots as having a $15.00 average cost per share. The question identifies the second lot as the one sold.
  • B. These amounts would apply if you sold the first lot and kept the second.
  • C. The sold shares gain \(5(20-18)=\$10.00\). The five shares still held have \(5(20-12)=\$40.00\) of unrealised gain.

Find a finance concept

Press Enter to see all matching chapters.