Average Stock Price (Cost Basis) Calculator
Enter each stock purchase lot to calculate your weighted average buy price. Optionally enter current market price to estimate unrealized gain/loss.
Average Stock Price = (Total Cost of All Purchases) ÷ (Total Shares Purchased)
where Total Cost includes trading fees if you add them.
How to use this average stock price calculator
If you buy the same stock at multiple prices over time, your true entry price is not your first purchase or your latest one. It is the weighted average of all your purchases, often called your average cost basis. This calculator helps you compute that number quickly and accurately.
- Add each purchase lot with shares, buy price, and optional fee.
- Click Calculate Average Price.
- Review total shares, total cost, and weighted average cost per share.
- Optionally include the current stock price to estimate unrealized gain/loss.
What is average stock price?
Average stock price is the average amount you paid per share across multiple purchases. It is weighted by the number of shares in each transaction. This matters because buying 100 shares at $20 has a bigger effect than buying 5 shares at $40.
Weighted average formula
Suppose you bought:
- 10 shares at $100
- 20 shares at $80
Your total cost is $1,000 + $1,600 = $2,600. Total shares are 30. Your average stock price is $2,600 ÷ 30 = $86.67.
Why investors track average cost basis
Knowing your average buy price helps with decision-making and risk control:
- Break-even planning: You can see the exact price needed to recover your investment.
- Position management: You know whether a new buy lowers or raises your cost basis.
- Performance tracking: Unrealized profit/loss is clearer when cost basis is accurate.
- Tax awareness: Average cost and lot selection affect realized gains when you sell.
Dollar-cost averaging and average stock price
Many long-term investors use dollar-cost averaging (DCA), investing fixed amounts regularly regardless of price. Over time, this creates many purchase lots. Your weighted average price becomes the benchmark to evaluate whether the market price is above or below your overall entry level.
Even if you are not intentionally using DCA, every repeated buy creates a similar effect. A simple calculator keeps that process transparent.
Common mistakes to avoid
1) Using a simple average instead of a weighted average
A simple average of prices ignores share quantity and can be significantly wrong. Always weight each purchase by shares.
2) Ignoring transaction fees
Commissions and transaction costs increase true cost basis. If your broker charges fees, include them in each lot for better accuracy.
3) Confusing average cost with tax-lot strategy
For taxes, some jurisdictions or broker settings use FIFO, LIFO, specific identification, or average cost methods. This tool is excellent for planning and monitoring, but always verify your broker's tax method and your local rules.
Practical example
Imagine you made these purchases:
- 25 shares at $50, fee $1
- 15 shares at $45, fee $1
- 10 shares at $40, fee $1
Total cost = (25×50+1) + (15×45+1) + (10×40+1) = $2,328.
Total shares = 50.
Average cost basis = $2,328 ÷ 50 = $46.56 per share.
If the current market price is $52, unrealized gain is (50×52) − 2,328 = $272.
Final thoughts
An average stock price calculator is a simple but powerful investing tool. It gives you a clear cost basis, supports disciplined buying, and helps prevent emotional decisions. Use it after every purchase so your records stay current, especially if you are building positions over time.