Dollar-cost averaging calculator
Invest a fixed amount every period and this shows what steady buying does to your cost per share: on the default dip-and-recover path, $500 a period for 24 periods averages in at $81.16 a share. Dollar-cost averaging is not a way to beat a lump sum — historically the lump sum wins about two times in three — so the tool compares both, honestly, below the worksheet.
Worksheet
- Total invested
- $12,000
- Average cost per share
- $81.16
- Shares bought
- 147.86
- Lump sum would be worth
- $13,200
- Which won on this path
- DCA won +$3,065
How the formula works
Dollar-cost averaging means investing a fixed amount every period regardless of price. Because the amount is fixed, a lower price buys more shares and a higher price buys fewer — you accumulate shares faster exactly when they are cheap. The number that captures this is your average cost per share: total money invested divided by total shares bought.
where \(A\) is the amount invested each period, \(n\) the number of periods and \(p_t\) the price at period \(t\). The \(A\) cancels, leaving the harmonic mean of the prices you paid. The harmonic mean is always at or below the ordinary average of the same prices, and it is dragged down hardest by the low ones — which is the whole mechanism: buying more shares when the price dips pulls your average cost below the simple average price.
But a lower average cost is not the same as a better outcome. Your ending value is total shares times the final price, and the lump-sum alternative — investing \(A\cdot n\) all at once at the starting price — buys its shares at a single price. Which one ends higher depends entirely on the path:
- Prices dip and then recover (the V-shape): DCA buys extra shares cheaply in the middle, so it ends ahead. This is the case the default worksheet shows.
- Prices rise steadily: every later DCA purchase pays more than the start, so DCA accumulates fewer shares than the lump sum bought at the low opening price — and the lump sum wins. On the worksheet's rising path the lump sum ends about $743 ahead.
- Prices are flat: every share costs the same, so DCA and lump sum are identical — same shares, same value.
Because a rising market is the historical norm, the lump sum wins more often than not — roughly two times in three in studies of long U.S. and global market histories. The honest case for dollar-cost averaging is not that it beats lump sum on average. It is that it lowers the risk and regret of a single badly-timed entry, and that it matches how most people actually invest: a fixed slice of each paycheck, money that does not exist yet to invest all at once.
What each input means
- Invested each period — \(A\)
- The fixed dollar amount you put in every period. Holding it constant is what makes the averaging work: the same dollars buy more shares when the price is low and fewer when it is high.
- Number of periods — \(n\)
- How many times you buy. A "period" can be a month, a paycheck or a quarter — the arithmetic is the same. Total money invested is simply \(A\times n\), and the lump-sum comparison invests that same total at period one's price.
- Starting share price — \(p_1\)
- The price at your first purchase. Every path is quoted relative to this, and the lump-sum alternative buys all of its shares here.
- Price path
- An illustrative, deterministic shape for how the price moves — not a forecast. Rising climbs 0.5% a period; V-shape falls to about 70% of the start by the midpoint and recovers to 110%; flat never moves; volatile oscillates ±15% around the start. Real prices are random; these fixed paths exist to show the mechanism cleanly, so the same inputs always give the same answer.
A worked example
Take the worksheet's defaults: $500 invested each period for 24 periods — $12,000 in total — starting at $100 a share, on the falling-then-recovering path. The price slides to about $69.85 at period 12, the midpoint, then climbs back to $110.00 by the end.
- Because each $500 buys more shares when the price is low, the steady buying accumulates 147.86 shares. Your average cost works out to $12,000 / 147.86 = $81.16 a share — well below the $100 starting price, because the cheap middle purchases pulled it down.
- At the final price of $110.00, those shares are worth 147.86 × $110.00 = $16,265.
- The lump-sum alternative put the whole $12,000 in at the $100 start, buying 120.00 shares. At the same $110.00 final price that is $13,200.
On this dip-and-recover path, steady buying ends $3,065 ahead — the reward for buying more shares while the price was down. Change the path to "Rising steadily" and the result flips: the lump sum, having bought everything at the low opening price, wins instead. That flip is the honest heart of the matter.
Assumptions and limits
- The price paths are illustrative and deterministic — chosen shapes, not forecasts. Real markets move randomly, and the historical record favors lump-sum investing on average because markets rise more often than they fall.
- The benefit of dollar-cost averaging shown here is behavioral and practical, not a return edge: it reduces the risk and regret of one badly-timed entry, and it lets you invest each paycheck as it arrives rather than needing the whole sum up front.
- Dividends, fees, taxes and any bid-ask spread are ignored. Reinvested dividends would lift both strategies; costs would trim both.
- The amount invested and the spacing of purchases are held constant, and no purchase is skipped. This is arithmetic on a fixed path, not advice about what any market will do.
Questions people ask
Does dollar-cost averaging beat investing a lump sum?
Usually not. Across long stretches of U.S. and global market history, putting the whole sum in at once has ended ahead of spreading it out roughly two-thirds of the time. The reason is mechanical: markets rise more often than they fall, so on average the money you hold back to invest later misses gains it could have been earning. Anyone selling DCA as a way to earn a higher return is misreading the record — its advantage shows up only when the price falls after you start and later recovers.
Then why dollar-cost average at all?
Two honest reasons. First, most people do not have a lump sum to invest — they have a paycheck, and investing a fixed slice of each one is dollar-cost averaging by necessity. Second, it reduces regret: committing a large sum the week before a drop is painful enough that many investors freeze and never invest at all. Averaging in trades a slightly lower expected return for a much smoother ride and a decision you are more likely to actually follow through on.
What exactly is my average cost per share?
It is total money invested divided by total shares bought, and it equals the harmonic mean of the prices you paid. Because a fixed dollar amount buys more shares when the price is low, the cheap purchases carry extra weight and pull the average down — so your average cost sits below the simple average of the prices, and can sit well below the starting price if the market dipped along the way.
Is dollar-cost averaging good in a bear market?
It helps only if the market later recovers. Buying steadily as prices fall lowers your average cost and stacks up shares cheaply, which pays off handsomely when they rebound — that is the V-shape case on this page. But if prices keep falling and never recover, a lower average cost on a still-losing position is cold comfort. DCA manages the timing risk of when you enter; it does nothing about whether the asset itself is worth holding.
How is this different from timing the market?
They are opposites. Market timing tries to buy low and sell high by predicting moves, which the evidence says almost no one does reliably. Dollar-cost averaging gives up on prediction entirely: you buy the same amount on a fixed schedule and let the price be whatever it is. It will not get you the best possible entry, but it guarantees you never put everything in at the single worst one — and it keeps you invested instead of waiting on the sidelines for a signal that rarely comes.