Skip to content
exactfigure.com
Changes the currency unit, not the numeric value. No conversion is performed.

Average cost calculator

After buying in several times, this calculator works out the weighted average price you paid — your average cost per share. For each purchase you enter the number of shares, the price and, optionally, the fee; it shows the average with and without fees, the total shares and the capital you put in. Add a current price and it also shows the unrealised gain or loss. It is a plain record of your own purchases — no price data, no tax working and no recommendation. Everything runs in your browser; nothing is stored or sent.

Enter your purchases and the calculator works out the weighted average cost per share. It uses no price data and does no tax or FIFO working. Every figure is your own. The calculation runs in your browser; nothing is stored.

Purchases

Comparison (optional)

What your result means

The cards give the average cost per share with and without fees, the total shares and the capital invested. The gap between the two averages is what the fees add to your cost per share. If you entered a current price, a second block shows the holding's value now and the unrealised gain or loss in money and per cent — a snapshot on your figures, not a valuation and not advice.

How this calculator works

The weighted average price is the total cost of all purchases divided by the total number of shares. For the average 'including fees', the buying fees are added to the cost; for 'excluding fees', only shares times price count. That shows how much the fees lift your average cost.

The capital invested is the sum of value bought (shares times price) plus fees across all purchases. If you add a current comparison price, the calculator works out the holding's value (price times total shares) and the unrealised gain or loss — in money as the difference from the capital invested including fees, and as a percentage of it.

The calculator pulls no price data and applies no tax rule (such as FIFO). The unrealised gain or loss is a snapshot on your inputs only. Internally the calculation is unrounded and only rounded for display.

Formula and variables

Average price=Total cost (incl. fees) / Total shares
Capital invested=Σ (shares · price) + Σ fees
Unrealised G/L=Current price · Total shares − Capital invested
Shares
shares bought in a purchase (fractions allowed)
Price
price per share at purchase
Fees
buying fees for that purchase
Current price
optional current price per share

Worked examples

Example 1: two purchases with a small fee

Example inputs
Purchase 1 (20 shares) — price€90.00
Purchase 1 — fee€5.00
Purchase 2 (15 shares) — price€110.00
Purchase 2 — fee€5.00
Example results
Average cost (incl. fees)€98.86
Average cost (excl. fees)€98.57
Total shares35
Capital invested€3,460.00

Two buys — 20 shares at €90.00 and 15 at €110.00, each with a €5.00 fee — cost €3,460.00 for 35 shares. That is €98.86 a share including fees, or €98.57 without. All figures are example assumptions.

Example 2: a top-up with fees and a current price

Example inputs
Purchase 1 (30 shares) — price€50.00
Purchase 1 — fee€9.90
Purchase 2 (20 shares) — price€65.00
Purchase 2 — fee€9.90
Current price per share€72.00
Example results
Average cost (incl. fees)€56.40
Capital invested€2,819.80
Current value€3,600.00
Unrealised gain/loss€780.20
Unrealised G/L (%)27.67%

Buying 30 shares at €50.00 then 20 at €65.00, with a €9.90 fee each, costs €2,819.80 for 50 shares — €56.40 a share including fees. At a current €72.00, the holding is worth €3,600.00, an unrealised gain of €780.20 (27.67%). All figures are example assumptions.

Assumptions

  • You record all the relevant purchases yourself.
  • Fees you include are added to the cost and so raise your average.
  • The current price is your own input, not a fetched market price.

Limitations of this calculator

  • No price data and no market valuation.
  • No FIFO, tax or disposal working (mentioned in words only, not calculated).
  • No recommendation to buy, hold or sell.
  • The unrealised gain or loss is a snapshot without guarantee.
  • No storage of your inputs (privacy by design).

Common misconceptions

  • Leaving out fees: Fees lift your real average cost; entering them shows the true cost per share, not just price times shares.
  • Reading the gain as realised: The gain or loss uses a current price you enter and is unrealised — nothing is bought, sold or taxed here.
  • Expecting tax lots (FIFO): This is a plain weighted average across your purchases, not a tax method for matching sold shares.
  • Expecting live prices: No price data is pulled in; the current price for the comparison is your own input.

Frequently asked questions

Are fees taken into account?

If you want. The calculator shows the average cost both with and without buying fees. Included, they add to the cost and raise your average per share — so you can see the difference directly.

Does it do FIFO or tax?

No. It only works out the weighted average price of the purchases you enter. Tax-lot methods such as FIFO and the taxation of gains are deliberately left out — that needs qualified advice for your own situation.

Where does the current price come from?

You enter it yourself. The calculator pulls no price data. The gain or loss it shows is unrealised and only a snapshot based on your input.

Can I enter fractional shares?

Yes. Share counts with decimals are allowed, for example from a regular investment plan. The average price is weighted correctly by the share counts you enter.

Sources and further reading

Official and independent sources on this topic. The links open each website in a new tab; no content is loaded from them into this page.

  • Cost BasisU.S. Securities and Exchange Commission (Investor.gov)Defines cost basis — what you paid for a holding — as the reference for a gain or loss.
  • Cost Basis for Securities TransactionsU.S. Securities and Exchange CommissionStates that cost basis is the purchase price plus purchase costs such as commissions.

Spotted an error in the calculation or the text?

If you notice something that is wrong or unclear: let us know via the contact page. We review every report.

Last reviewed: 28/07/2026 · All calculations run in your browser – inputs are not stored. ·How we check our calculators