Quick answer
The average cost per share = Σ(shares × price) ÷ Σ shares. Buying 100 shares at $10, 50 at $12 and 25 at $8 costs $1,800 for 175 shares, an average of $10.29.
Enter the shares and the price of each purchase. The calculator returns the average cost, total shares and total invested. Use this stock average calculator to check your own figures.
Related tools: Average Return Calculator: Arithmetic and geometric average of periodic returns. Stock Profit Calculator: Profit or loss on a stock trade after fees. Investment Calculator: Project investment growth from a rate of return you choose.
How to use the Stock Average Calculator
- Type shares per purchase, for example 100, 50, 25.
- Type price per share for each purchase, for example 10, 12, 8.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Shares per purchase | Text, such as 100, 50, 25 | — |
| Price per share for each purchase | Text, such as 10, 12, 8 | — |
Formula and method
Formula
average cost = Σ(shares × price) ÷ Σ shares
IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice.
Fees are not included; add them to the prices if you want them counted.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Shares per purchase = 100, 50, 25; Price per share for each purchase = 10, 12, 8.
| Result | Value |
|---|---|
| Average cost per share | $10.29 |
| Total shares | 175 |
| Total invested | $1,800.00 |
Example 2
Inputs: Shares per purchase = 10, 10; Price per share for each purchase = 20, 30.
| Result | Value |
|---|---|
| Average cost per share | $25.00 |
| Total shares | 20 |
| Total invested | $500.00 |
The first line is the headline result (average cost per share). Below it the stock Average Calculator lists total shares and total invested, which describe the same case from other angles. IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice.
Dollar-cost averaging
Buying a fixed dollar amount regularly buys more shares when prices are low, which lowers the average cost. The weighted average here ($10.29) is higher than the simple average of the prices ($10.00) because more shares were bought at $10 than at $8.
Taxes
The average cost is the basis for gain or loss on a sale under the average-cost method; some jurisdictions require specific-lot or FIFO methods. Fees are not included.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Price per share for each purchase: entering "5" shows "Enter one price for every share count." beside that field and no result.
- Shares per purchase: entering "0, 0" shows "The total number of shares must be positive." beside that field and no result.
Choosing between the Stock Average Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Average Return Calculator](/finance/average-return-calculator/) | returns per period | Geometric average return |
| [Stock Profit Calculator](/finance/stock-profit-calculator/) | shares, buy price per share and sell price per share | Profit |
| [Investment Calculator](/finance/investment-calculator/) | initial amount, annual interest rate and years | Projected value |
| [Financial Calculator](/finance/financial-calculator/) | solve for, periods per year and payments | Future value (FV) |
| [IRR Calculator](/finance/irr-calculator/) | initial investment and cash flows | IRR |
Background: interest, saving and investing
A nominal rate (APR) does not include the effect of compounding; the annual percentage yield (APY) does: APY = (1 + r/n)^n − 1. A 5% nominal rate compounded annually is 5.000%, semi-annually about 5.063%, quarterly about 5.095% and monthly about 5.116%, so more frequent compounding helps, but with diminishing returns.
The rate you enter in a projection is an assumption, not a promise: real returns vary and can be negative. Fees and taxes are not modelled unless the page says so.
Assumptions and limitations
- Both lists must be the same length
Results are estimates for planning, not financial advice. Lender terms, fees, taxes and rounding rules can change real figures, so confirm important numbers with your lender or a licensed adviser.
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for price per share for each purchase and shares per purchase to confirm this.
Frequently asked questions
Why is it not just the mean of prices?
Each purchase has a different number of shares.
Does it include fees?
No. The average cost uses prices and shares only; commissions would raise your true cost basis.
How does a new buy change it?
Add the new shares and cost to the totals.
What does the Stock Average Calculator calculate?
Average cost per share across several purchases. It returns Average cost per share, Total shares and Total invested.
What formula does the Stock Average Calculator use?
average cost = Σ(shares × price) ÷ Σ shares. Fees are not included; add them to the prices if you want them counted.
What do I need to enter in the stock Average Calculator?
You enter Shares per purchase and Price per share for each purchase.
How is the result rounded or limited?
IEEE-754 double precision; money shown to cents, rates to 4 decimals. Results are estimates, not financial advice. Both lists must be the same length.
What is an example of a stock Average result?
With shares per purchase 100, 50, 25 and price per share for each purchase 10, 12, 8, the average cost per share is $10.29.
Can I rely on this calculator for a decision?
Results are estimates for planning, not financial advice. Lender terms, fees, taxes and rounding rules can change real figures, so confirm important numbers with your lender or a licensed adviser. For this calculator in particular: Both lists must be the same length.
Related calculators
- Average Return Calculator — Arithmetic and geometric average of periodic returns.
- Stock Profit Calculator — Profit or loss on a stock trade after fees.
- Investment Calculator — Project investment growth from a rate of return you choose.
- Financial Calculator — Time-value-of-money solver for N, rate, present value, payment or future value.
- IRR Calculator — Internal rate of return of an investment from its yearly cash flows.
- CAGR Calculator — Compound annual growth rate between two values.
Sources
- Standard time-value-of-money relations (e.g. Brealey, Myers & Allen, Principles of Corporate Finance)
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.