Dollar-Cost Averaging Calculator
See what investing the same amount at every price in a series buys you: shares, average cost per share, and value. Shows why your average cost lands below the average price, and how a lump sum would have done.
How to Use
- Enter the amount you invest each time, such as $500 a month.
- Type the price at each purchase, in order, separated by commas, spaces or new lines — or click a preset series.
- Add a fee per purchase if your broker charges one, and choose whole shares only if fractions aren’t allowed.
- Read your average cost per share next to the plain average of the prices, the shares bought and their value at the last price.
- Check the comparison table to see how a lump sum at the first price would have done.
Worked Example
Through a dip and back. You invest $500 a month while the price goes $50, $40, $25, $40, $50. Each $500 buys 500 ÷ price shares: 10 + 12.5 + 20 + 12.5 + 10 = 65 shares for $2,500. Your average cost is 2,500 ÷ 65 = $38.46 a share. At the final $50 the shares are worth $3,250, a $750 gain, although the price ended exactly where it began.
Why it is the harmonic mean. With n equal purchases of $A, the shares are A × (1/p1 + … + 1/pn), so the cost per share is nA ÷ that = n ÷ (1/p1 + … + 1/pn) — the harmonic mean of the prices. For the dip it is 5 ÷ 0.13 = $38.46.
The common mistake: taking the average of the prices as your cost. (50 + 40 + 25 + 40 + 50) ÷ 5 = $41.00 is what you would pay if you bought the same number of shares each month; buying 12.1951 shares each time costs the same $2,500 but gets you only 60.9756 shares, worth $3,048.78. A fixed dollar amount does better, at $38.46 a share.
Show Work
Formulas
An Old Habit with a Mathematical Edge
Benjamin Graham recommended dollar-cost averaging to the “defensive investor” in The Intelligent Investor: put the same amount into stocks every month or quarter, and you buy more shares when prices are low without having to guess when that is. Payroll-deducted retirement plans made it the default for millions of savers, usually without the name.
The lower average cost is not a market effect but arithmetic: for any set of positive prices, the harmonic mean is at most the arithmetic mean. What averaging cannot do is make a falling investment profitable, or beat a lump sum in a market that mostly rises — it trades some expected return for protection against putting everything in at a peak.
About This Calculator
This calculator invests a fixed amount at every price you type, with an optional flat fee per purchase and an option for whole shares only, where unspent cash carries to the next purchase. It reports your average cost per share against the plain average of the prices, and compares the same total invested as a lump sum at the first price and as a fixed number of shares each time. Dividends and taxes are left out; the Dividend Calculator covers reinvested income.
All calculations run in your browser; nothing you enter is sent to a server.
Estimates for planning and education — not financial, tax or legal advice.
Related tools: Investment Calculator, Dividend Calculator, and CAGR Calculator.
Frequently Asked Questions
What is dollar-cost averaging?
Investing the same dollar amount at regular intervals, whatever the price. $500 a month at prices of $50, $40, $25, $40 and $50 buys 10, 12.5, 20, 12.5 and 10 shares: 65 shares for $2,500. You buy more when the price is low and fewer when it is high.
Why is my average cost lower than the average price?
Because a fixed dollar amount buys more shares at low prices, which pulls the cost per share down. Your average cost is the harmonic mean of the prices: 5 ÷ (1/50 + 1/40 + 1/25 + 1/40 + 1/50) = $38.46, against an arithmetic average of $41.00. The harmonic mean is never above the arithmetic mean; they are equal only if every price is the same.
Is dollar-cost averaging better than investing a lump sum?
Only when prices fall. Investing $1,800 as $300 a month while a price climbs from $20 to $30 ends with $2,201.67; the same $1,800 invested at $20 on day one ends with $2,700. When the price falls from $100 to $50, averaging in ends with $1,268.45 against $900. Because markets have risen more often than they have fallen, a lump sum has historically come out ahead more often than not — averaging in mainly reduces the regret of bad timing.
How do fees affect dollar-cost averaging?
A flat fee takes a bigger share of small purchases. $100 a week with a $1 fee at $10, $8, $5, $8 and $10 buys 64.35 shares at an average cost of $7.77, above the $7.69 it would be without the fee. Brokers that charge no commission, and fractional shares, make small regular purchases far more efficient.
What if I can only buy whole shares?
Then the money left over waits for the next purchase. $250 a month at $87.50, $92.10, $78.40, $84.95, $95.30 and $101.20 buys 16 whole shares at an average cost of $89.35, with $70.35 of cash left over; at the last price the holding plus cash is worth $1,689.55.
How do I use the Dollar-Cost Averaging Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Workplace retirement plans
Payroll contributions to a 401(k) are dollar-cost averaging: the same amount buys fund units every pay day.
A volatile stock
$500 a month through a dip from $50 to $25 and back buys 65 shares worth $3,250 — a $750 gain though the price ended where it started.
A falling market
$300 a month while a price slides from $100 to $50 loses $531.55 of $1,800, against $900 for a lump sum at the top.
A choppy year
$200 a month over 12 months between $38.90 and $52.30 buys 53.6092 shares at $44.77 each, below the $45.13 average price.
Checking a broker statement
Type the prices from your purchase history to confirm the average cost your broker reports.
Last updated: