Stock average cost calculator
Calculate the weighted-average cost basis across multiple buy lots at different prices.
The stock average cost calculator takes a list of separate buy transactions (each with its own price and share count) and computes your total shares, total cost, and weighted-average cost per share — useful whenever you've bought into a position gradually rather than all at once.
How to use
- Add a row for each separate purchase (buy lot) with its price and number of shares.
- Click "Calculate" to get your total shares, total cost, and weighted-average cost per share.
Common use scenarios
- Calculating your true average cost after buying a stock in several separate purchases.
- Checking how a new purchase would change your overall average cost before buying.
- Reconciling your own records against a brokerage statement's reported average cost.
- Understanding your break-even price after multiple buy-ins at different prices.
✓Content & verification reviewed: 2026-08-27
How we verify Stock average cost calculator
How to confirm the calculated average cost matches your own math.
Average cost = total cost ÷ total shares, weighted by each lot's size
A lot with more shares pulls the average toward its price more than a smaller lot does — this is why the result generally isn't a simple average of the prices alone, especially when lot sizes differ a lot.
This doesn't include trading fees or taxes unless you build them into the price
If you want fees reflected in the average cost, add them into each lot's price per share before entering it (e.g. enter your true all-in cost per share, not just the quoted market price).
Adding or removing a lot recalculates everything from scratch
There's no dependency on the order you enter lots in — the total shares, total cost, and average are always computed fresh from whatever complete set of lots is currently in the list.
Before you rely on the result
- You've entered every buy lot you want included, with accurate price and share counts.
- You've decided whether to fold trading fees into each lot's price, and done so consistently if you did.
- The total shares figure matches your own count of shares purchased.
- You've compared the result against your brokerage's reported average cost if you're reconciling records.
Who this is for
- Anyone calculating their true average cost after multiple stock purchases.
- People checking how a planned new purchase would shift their average cost.
- Anyone reconciling their own records against a brokerage statement.
- People wanting to understand their break-even price after multiple buy-ins.
Real-world examples
Calculating true average cost
An investor who bought shares in three separate purchases at different prices enters all three lots to get their overall weighted-average cost per share.
Planning a new purchase
Someone adds a hypothetical new lot to see how it would shift their average cost before actually placing the trade.
Reconciling brokerage records
An investor re-enters their purchase history to double-check that their brokerage's reported average cost matches their own calculation.
Limitations
- Doesn't account for trading fees or taxes on the purchases — enter fee-inclusive prices per share if you want those reflected.
Frequently asked questions
Why isn't the average cost just the average of my purchase prices?
It's weighted by how many shares each purchase involved — a lot with more shares pulls the average toward its price more strongly than a smaller lot does.
Does this include the fees I paid on each trade?
Not automatically — if you want fees reflected, add them into each lot's price per share (your true all-in cost) before entering it.
Does the order I enter my lots in matter?
No — the total shares, total cost, and average are recalculated from the complete current list every time, regardless of entry order.
Can I use this for a stock I've sold some shares of too?
This calculator only handles buy lots — it doesn't model partial sales or the accounting method (FIFO/LIFO/average) your broker uses for a sale's cost basis.
🔒 Runs in your browser — nothing is uploaded. Results are for reference only; see the disclaimer. Last updated: 2026-08-27
Subscribe for updates
New tools and tips, straight to your inbox. No spam, unsubscribe anytime.