Stock Average Cost Calculator — Dollar Cost Averaging
If you have bought the same stock at different prices, this calculator finds your average cost per share using a weighted average of all your purchase lots. It also shows unrealized gain or loss based on the current market price.
$
$
$
$
$
Weighted average of all purchase lots
- 1
Total cost basis
50 × 100 + 45 × 150 + 42 × 200 = 20,150Sum of each lot's purchase price multiplied by its share count. - 2
Total shares
100 + 150 + 200 = 450 - 3
Average cost per share
20,150 ÷ 450 = 44.7778
How does this calculator work?
Average Cost = Total Dollars Invested ÷ Total Shares Purchased. It is a weighted average — lots where you bought more shares count more. Enter up to four purchase lots and an optional current price to get your blended cost basis and unrealized profit or loss instantly.
Formula
How this is calculated
When you buy shares of the same stock at multiple price points — whether dollar-cost averaging on a schedule or buying more after a drop (averaging down) — your true cost basis is a weighted average, not a simple average of prices. Weighting by share quantity means lots where you bought more shares influence the average more than smaller lots bought at a different price. The formula sums (price × quantity) across all lots and divides by total shares.
For example, buying 100 shares at $50 and then 200 shares at $44 gives an average cost of (100×$50 + 200×$44) / 300 = $46. A simple average of $50 and $44 would give $47 — the wrong answer because the second lot was twice as large.
The unrealized gain or loss multiplies the difference between the current market price and your average cost by your total share count. This is "unrealized" because you have not yet sold — the actual profit or loss only crystalizes when you close the position. This calculator does not account for commissions, dividends, stock splits, or wash-sale rules.
Frequently asked questions
Dollar-cost averaging (DCA) means investing a fixed dollar amount at regular intervals regardless of the share price. When prices are low you buy more shares, when prices are high you buy fewer — so your average cost per share tends to be lower than the average price over the period. It removes the need to time the market perfectly.
Averaging down means buying more shares of a stock that has fallen in price to lower your average cost basis. This improves your break-even price, but it also concentrates more money in a position that is already underperforming. It works when the price eventually recovers, but can amplify losses if the stock continues to fall.
Yes. Your taxable cost basis depends on the accounting method your broker uses. The default in many countries is FIFO (first-in, first-out), but average cost is permitted for mutual funds and some brokerages. Check with your broker which method applies to your account before using this figure for tax purposes.
Also known as
TG we-Calculate Editorial Team. (2026). Stock Average Cost Calculator — Dollar Cost Averaging [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/stock-average-calculator
TG we-Calculate Editorial Team. "Stock Average Cost Calculator — Dollar Cost Averaging." TG we-Calculate. 2026. https://we-calculate.com/calculator/stock-average-calculator.
TG we-Calculate Editorial Team, "Stock Average Cost Calculator — Dollar Cost Averaging," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/stock-average-calculator
@misc{wecalculate_stock_average_calculator, title = {Stock Average Cost Calculator — Dollar Cost Averaging}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/stock-average-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
