United Kingdom version. Pounds and pence, 0.5% Stamp Duty Reserve Tax on UK share purchases added to each buy, and how the average relates to HMRC's Section 104 pool for Capital Gains Tax. US version

Share Average Price Calculator (UK)

Average price per share in pounds across several buys, including dealing fees and 0.5% stamp duty, with break-even and how many shares to buy to average down.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Stock Average Calculator?

For UK shares the average cost has a tax meaning. HMRC pools shares of the same class in the same company into a Section 104 holding, and each share in the holding is treated as if it was acquired at the same average cost. Selling part of the pool takes shares out at that average, which is exactly what this calculator does with a sell row.

Two things change the numbers for UK investors. Buying existing shares in a UK company electronically usually costs 0.5% Stamp Duty Reserve Tax, and HMRC's Capital Gains Manual counts stamp duty and transfer costs as allowable incidental costs. So add the SDRT and your dealing charge together in each buy's fee box. The pool's average then matches what you would use in a gains calculation.

HMRC matches a sale first with shares bought the same day, then with shares bought in the following 30 days, and only then with the Section 104 pool. If you sold and bought back within 30 days, the average here is not the cost HMRC will use for that sale.

  • Weighted average cost across any number of buys, with fees
  • Sells under the average cost method with realized gain or loss
  • Running average after every trade
  • Shares needed to reach a target average at the current price
  • Break-even price, market value and unrealized gain
  • Share link that stores your trades, runs in your browser
Read the guide: Average Cost per Share: Averaging Down, Break-Even and Cost Basis

Updated

How to use the Stock Average Calculator

  1. Enter each trade in date order: choose Buy or Sell, then the number of shares, the price per share and the fee for the whole trade.
  2. Add or delete rows as needed. The average is recalculated after every trade in the running-average table.
  3. Enter the current share price to see market value and unrealized gain or loss.
  4. To average down or up, type a target average to get the shares and cash needed, or type a number of shares to buy and see the new average.
  5. Add a sell fee if you want the break-even price to include it, then copy or share the result.

Worked examples

Two buys with dealing charge and stamp duty

Input

Buy 200 at £4.50, fee £5.99 + £4.50 SDRT; buy 300 at £3.80, fee £5.99 + £5.70 SDRT; sell fee £5.99

Output

500 shares, average £4.1244, cost £2,062.18; break-even £4.1363

Without costs the average would be £4.08. Fees and stamp duty add about 4.4p a share, which matters on a small holding.

Selling part of the pool

Input

Same pool, then sell 150 at £4.60 with a £5.99 fee

Output

350 shares left at £4.1244; realised gain £65.36

The sale takes 150 shares out at the pool average, as a Section 104 disposal does, so the remaining average does not change. Same-day and 30-day matching would override this if they applied.

Background and insight

The average cost is a weighted average, not the average of the prices. Buying 100 shares at $50 and 50 shares at $40 costs $7,000 for 150 shares, an average of $46.67, not $45, because more shares were bought at the higher price. Fees belong in the cost: a $5 commission on each of two buys adds $10 to the basis and raises the average slightly.

Averaging down solves one equation. If you hold S shares at an average A and buy n more at price P, the new average is (S x A + n x P) / (S + n). Setting that equal to a target T and solving gives n = S x (A - T) / (T - P). The target must lie between the current price and your average: buying at $30 can pull a $46.67 average toward $30 but never to $30 or below, and the closer the target gets to the price, the more shares it takes. Reaching $38 from 150 shares at $46.67 takes 162.5 shares costing $4,875.

For taxes, the cost basis rules in IRS Publication 550 and Treasury regulation 1.1012-1 apply. For individual stocks the default is first in, first out (FIFO), unless you tell your broker which specific lots you are selling; the average basis method is allowed for mutual fund shares and shares acquired through a dividend reinvestment plan. So the average shown here is right for judging your position and break-even, but the gain your broker reports on Form 1099-B can differ if it uses FIFO or specific lots.

Common use cases

  • Deciding whether to average down

    See exactly how many shares and how much cash it takes to move your average to a level you care about.

  • Setting a break-even sell price

    Know the price at which selling the whole position covers every purchase and fee.

  • Tracking a position built over time

    Keep a running average for regular purchases of the same stock or ETF.

  • Checking a broker statement

    Reconcile the average cost your broker shows with your own trade history.

Tips and limitations

  • Stamp duty does not apply to every purchase: GOV.UK lists new share issues and OEIC or unit trust units bought from the fund manager among the exceptions, and foreign shares bought outside the UK generally do not attract it.
  • Keep contract notes. They show the price, commission and SDRT for each trade, which is what the fee box needs.

Sources and further reading

  1. Shares and Capital Gains Tax (HS284), HM Revenue and Customs. Same-day and 30-day matching, and the Section 104 holding at average cost.
  2. Tax when you buy shares, GOV.UK. 0.5% Stamp Duty Reserve Tax on electronic purchases, 1.5% for some schemes, and the exemptions.
  3. Capital Gains Manual CG15250: incidental costs, HM Revenue and Customs. Allowable incidental costs include costs of transfer such as stamp duty.

Frequently asked questions

What is a Section 104 holding?

It is HMRC's pool of shares of the same class in the same company. Shares not matched by the same-day or 30-day rules go into it, and each share in the pool is treated as acquired at the same average cost.

Do I include stamp duty in my share cost?

Yes for the pool. HMRC's Capital Gains Manual lists costs of transfer, including stamp duty, among the allowable incidental costs of acquisition. Add the 0.5% SDRT and your dealing charge to each buy's fee.

How much stamp duty do I pay when buying UK shares?

Usually 0.5% of the purchase when you buy electronically, as Stamp Duty Reserve Tax. On £900 of shares that is £4.50. Transfers into some depositary receipt schemes or clearance services are charged at 1.5%.

What is the 30-day rule for shares?

If you sell shares and buy the same shares back within 30 days, HMRC matches the sale with the new purchase instead of the pool. It stops "bed and breakfasting" to realise a gain or loss without really changing your holding.

How many more shares do I need to bring my average down?

Use shares held x (average - target) / (target - price). The "Target average" box does it for you. The target must sit between today's price and your current average, and new buys add their own stamp duty and fees.

Is there an in-depth guide to the Stock Average Calculator?

Yes. “Average Cost per Share: Averaging Down, Break-Even and Cost Basis” covers the background, how it works, common pitfalls and worked examples. Read the full guide.