How to use the dollar cost averaging calculator
- Enter the amount you invest each period. This is the fixed sum you put in every month, week or quarter, before fees.
- Choose how often you buy. The setting only labels the chart and table; the calculation is the same for any interval.
- Paste the share prices at each purchase, in order, separated by commas or on separate lines. For a past plan, use the prices you actually paid from your broker’s statements. To test a stock’s history, read monthly closing prices off a chart. The example is a year of monthly prices that fall about 27% and then recover to above where they started.
- Add a fee per purchase if your broker charges one. Many automatic investment plans have no fee.
The calculator values the position at the last price in the list. The chart shows the share price at each purchase against your running average cost: whenever the price line is above the blue line, the position is in profit. The table lists every purchase with the shares bought, the running total and the profit or loss at that point.
How dollar cost averaging is calculated
Each period, a fixed amount buys as many shares as it can at that period’s price:
Average cost per share = Total invested ÷ Total shares = (n × A) ÷ Σ [(A − F) ÷ Pi]
Average price = (P1 + P2 + … + Pn) ÷ nA is the amount invested each period, F the fee per purchase, Pi the price in period i and n the number of purchases. Value = Total shares × last price.
With no fees, the average cost is the harmonic mean of the prices, and the average price is their arithmetic mean. A basic mathematical fact is that the harmonic mean is never larger than the arithmetic mean, and is strictly smaller whenever the numbers differ. That is the whole of the “averaging” advantage: when you spend a fixed amount, cheap periods buy more shares and so carry more weight in your average.
The lump-sum comparison invests the same total at the first price, with a single fee:
A worked example
You invest $500 at the start of every month for a year. The price starts at $50.00, falls to $36.50 in month six, and recovers to $53.20.
Over 12 purchases you put in $6,000.00 and buy 135.0742 shares. The simple average of the twelve prices is $44.98, but your average cost is $44.42, 1.25% lower, because the months near the bottom bought the most shares.
At the last price the shares are worth $7,185.95, a profit of $1,185.95 or +19.77%, even though the price rose only 6.4% from where you started.
Investing the full $6,000.00 at the first price would have bought 120 shares, now worth $6,384.00. In this case the staged purchases came out $801.95 ahead.
The effect is clearest when the price simply returns to where it began. If the last two months had been $49 and $50 instead, a lump sum would show exactly no gain, while the monthly plan would be up $799.92, because the shares bought during the dip are worth more at $50 than they cost.
When DCA beats a lump sum, and when it does not
The outcome depends entirely on the path of the price. Using the same $500 a month for twelve months:
| Price path | DCA value | DCA profit | Lump-sum value | Lump-sum profit |
|---|---|---|---|---|
| Dip and recovery ($50 → $36.50 → $53.20) | $7,185.95 | $1,185.95 | $6,384.00 | $384.00 |
| Steady rise ($50 → $69.10) | $7,092.74 | $1,092.74 | $8,292.00 | $2,292.00 |
| Steady fall ($50 → $25.50) | $4,430.39 | -$1,569.61 | $3,060.00 | -$2,940.00 |
In a rising market, a lump sum wins because every dollar is invested at the lowest price of the year; dollar cost averaging leaves money waiting while the price climbs. In a falling market, DCA loses much less, because later purchases are made at lower prices. A dip followed by a recovery is the case where DCA shines.
Since stock markets have historically risen in most years, a lump sum invested immediately has usually ended up ahead when the money was available all along. The case for dollar cost averaging rests on two other points. First, most people do not have a lump sum: they invest from income, so regular purchases are simply how saving works. Second, spreading a large sum over several months limits the damage from bad timing and makes it easier to stick with the plan, which matters if a sharp fall right after investing would push you to sell.
What changes the result most
- The final price. The value is measured at the last price, so the same purchases can show a gain or a loss depending on the day you stop. Check how sensitive your result is by changing the last number in the list.
- Volatility. The bigger the swings, the larger the gap between your average cost and the average price. With prices that never change, the two are equal and DCA has no effect.
- Fees. A fixed fee takes a bigger bite from small purchases. With a $5 fee, the example’s average cost rises to $44.87; on purchases of $100 a month the same fee eats 5% of every purchase and pushes the average cost to $46.76. With per-trade fees, buying less often in larger amounts costs less.
- Time. Over many years, each new purchase is a smaller share of the total, so the averaging effect fades and the long-run return of the investment itself dominates. The investment calculator projects that longer-term growth.
Mistakes to avoid
- Stopping during the fall. The purchases made near the bottom produce most of the benefit. Pausing a plan when prices drop removes exactly those purchases.
- Comparing with the wrong benchmark. “My average cost is below the average price” is always true when prices vary, so it is not evidence that the plan worked. Compare the final value with what the same money would have earned elsewhere.
- Treating DCA as risk control for a single stock. Averaging purchases into one company does not reduce the risk that the company itself fails. Diversification does that; DCA only spreads your entry over time.
What this calculator does not include
- Dividends. Reinvested dividends buy extra shares and raise the value; the dividend reinvestment calculator models them.
- Interest on cash waiting to be invested. In the lump-sum comparison, the DCA investor’s uninvested money could be earning interest, which narrows the gap slightly.
- Fractional shares. The calculator assumes each purchase can buy fractional shares, as most brokers and automatic plans allow. With whole shares only, small leftover amounts would carry over to the next purchase.
- Taxes. Each purchase is a separate tax lot with its own cost basis and holding period, which matters when you sell part of the position.