TC TradeCaliper

Stock Average Calculator

Weighted average cost basis across any number of buy lots — fractional shares supported.

SharesBuy priceRemove
$
$
Average cost
$47.33
Total shares
150
Total cost
$7,100.00

No signup · Your numbers stay in your browser · 100% free

How to use it

Add a row for each time you bought the stock: the number of shares and the price you paid. The calculator keeps a running weighted average cost, your total shares, and your total invested. Add as many lots as you need, and remove any row you entered by mistake.

How weighted average cost works

Your average cost isn’t a simple average of the prices you paid — it’s weighted by how many shares you bought at each price. The formula is average = (Σ shares × price) ÷ (Σ shares). Buy 100 shares at $50 and 50 at $42 and your average isn’t $46; it’s ($5,000 + $2,100) ÷ 150 = $47.33, because the $50 lot carries twice the weight of the $42 lot.

Why exact math matters

Cost-basis math done with ordinary floating-point arithmetic can drift by fractions of a cent, which looks wrong on a position summary. TradeCaliper computes every average with exact decimal arithmetic, so what you see is what the numbers actually are.

TradeCaliper is a planning and education tool, not financial advice.

Trade with sharper numbers

Occasional emails on position sizing, risk, and new TradeCaliper tools. No spam, unsubscribe anytime.

Free · No trading advice · Unsubscribe in one click.

Frequently asked questions

How do I calculate the average cost of a stock?

Multiply the shares in each purchase by their price to get each lot’s cost, add all the lot costs together, and divide by the total number of shares. The result is your weighted average cost per share. This calculator handles any number of lots and fractional shares automatically.

What is a weighted average cost basis?

A weighted average cost basis accounts for the fact that you may have bought different numbers of shares at different prices. Rather than a simple average of the prices, it weights each price by how many shares you bought at it — which is what actually determines your break-even.

Does this handle fractional shares?

Yes. Enter fractional share quantities (like 1.5 or 0.25) and the calculator computes the weighted average correctly using exact decimal math, so there’s no rounding drift.

Is my average cost the same as my break-even price?

For a long stock position, yes — your weighted average cost is the price at which the position breaks even, before commissions and taxes. If the market price is above your average you have an unrealized gain; below it, an unrealized loss.

More trader tools

Put this calculator on your site

Free to embed. The snippet keeps a small credit link back to TradeCaliper.

<iframe src="https://tradecaliper.com/embed/stock-average-calculator" style="width:100%;min-height:640px;border:1px solid #e5e5e5;border-radius:8px" loading="lazy" title="Stock Average Calculator"></iframe>
<p style="font-size:13px">Calculator by <a href="https://tradecaliper.com/stock-average-calculator/">TradeCaliper</a></p>