BrokerCSV

How to work out capital gains on shares for Self Assessment

If you sold shares or funds outside an ISA or pension between 6 April 2025 and 5 April 2026, you may need to report the gains on your Self Assessment return, due online by 31 January 2027. The hard part is usually collecting every trade. Here's how to do it from your broker statements.

Guide for 2025/26 tax year · Updated 23 November 2026

Do you need to report?

For the 2025/26 tax year, you report capital gains on your return if either of these applies (GOV.UK):

Shares and funds held in an ISA are free of Capital Gains Tax, so leave those accounts out.

1. Collect every buy and sell

You need each trade's date, quantity, price, and fees, for every share you sold and every earlier purchase of the same shares, even purchases from years ago. Brokers put these in transaction histories, contract notes and periodic statements, usually as PDFs.

  1. Download the statements or transaction history covering every purchase of the shares you sold. See the broker guides for where each broker keeps them.
  2. Drop each PDF onto BrokerCSV. The transaction tables come out as Excel sheets with real numbers and dates, and tables that run over several pages are joined into one.
  3. Copy the rows into one sheet with columns for date, holding, buy or sell, quantity, price, fees and total.

2. Match each sale to purchases

HMRC doesn't let you pick which shares you sold. Each sale is matched in this order (HMRC Capital Gains Manual CG51560):

  1. Same day: shares of the same company bought on the day of the sale.
  2. Next 30 days: shares of the same company bought in the 30 days after the sale (the "bed and breakfasting" rule).
  3. Section 104 holding: everything else, treated as one pool at its average cost.

Most sales fall under the third rule. Sort your sheet by holding, then by date, so each company's trades sit together.

3. Work out the gain

The gain is what you sold for, less your dealing fees, minus the share of the pool's cost that you sold. You can include stockbroker fees and the Stamp Duty Reserve Tax you paid when buying (GOV.UK).

TradeSharesCost or proceedsPool after
Buy at £10, £10 fee100£1,010100 shares, £1,010
Buy at £14, £10 fee100£1,410200 shares, £2,420
Sell at £16, £10 fee150£2,390 received50 shares, £605

The 150 shares sold were three-quarters of the pool, so their cost is three-quarters of £2,420, which is £1,815. The gain is £2,390 − £1,815 = £575, and 50 shares stay in the pool at a cost of £605.

Add up the gains (and losses) on every sale in the tax year. Losses can be set against gains in the same year.

4. Rates and deadline

For 2025/26, gains above the £3,000 allowance are taxed at 18% if they fall within the basic rate band and 24% above it (GOV.UK rates). The online return and any tax owed are due by 31 January 2027 (GOV.UK deadlines).

HMRC's helpsheet HS284 has more worked examples, including the 30-day rule.

For a step-by-step example of matching, see the 30-day rule explained.

If you hold shares jointly or bought them in another currency, see joint accounts, spouses and foreign shares.

Get your statements into a spreadsheet

Convert a statement

This guide explains the general rules and how to get the numbers out of your statements. It isn't tax advice: check GOV.UK or ask an accountant about your own situation.

More guides