Dollar-Cost Averaging (DCA) Calculator

The dollar-cost averaging calculator computes total shares purchased, average cost per share, and ending value when the same amount in your currency is invested across a list of period prices, alongside a lump-sum comparison at the first period price.

Inputs: Amount — per period (your currency), and 2 to 36 period prices (your currency). Illustrative sequence (made-up prices for illustration, not real market data): $10.00, $8.00, $5.00, $8.00, $10.00.

Default preview ($100.00/period): Total invested = $500.00, Total shares = 65.0000, Average cost per share = $7.6923 (Simple avg price = $8.20), Ending value = $650.00, Lump sum at period 1 = $500.00.

Average cost per share is lower than the simple average price whenever prices vary, because the same contribution buys more shares when prices are low.

Period Price Invested Shares bought Cumulative shares
1 $10.00 $100.00 10.0000 10.0000
2 $8.00 $100.00 12.5000 22.5000
3 $5.00 $100.00 20.0000 42.5000
4 $8.00 $100.00 12.5000 55.0000
5 $10.00 $100.00 10.0000 65.0000

Educational tool. Results are simple calculations based only on the numbers you enter. They are not predictions and not financial advice.

How it works

For each period i in your price list, dividing the fixed amount per period by that period's price gives the shares bought in that period. Summing all period purchases gives total shares, and multiplying the fixed amount by the number of periods gives total invested. Dividing total invested by total shares produces your average cost per share (the harmonic mean of the prices). Valuing those total shares at the final period price gives ending value, monetary gain or loss, and percentage gain or loss. For comparison, lump-sum investing puts the same total amount into period 1 at the first price and values those shares at the final price. Average cost per share is lower than the simple average price whenever prices vary, because the same contribution buys more shares when prices are low.

Total invested = X * n
Shares per period = X / p_i; Total shares = sum(X / p_i)
Average cost per share = Total invested / Total shares
Current value = Total shares * p_n
DCA gain/loss = Current value - Total invested; (%) = (Gain/Loss / Total invested) * 100
Lump-sum shares = Total invested / p_1; Lump-sum value = Lump-sum shares * p_n
Simple average price = sum(p_i) / n

Worked example

Using illustrative inputs of $100.00 per period across 5 made-up prices ($10.00, $8.00, $5.00, $8.00, $10.00 — made-up prices for illustration, not real market data): total invested is $500.00, shares bought per period are 10, 12.5, 20, 12.5, and 10 for 65 total shares, and average cost per share is $7.6923 (unrounded: 7.6923), compared with a simple average price of $8.20. Valued at the final price of $10.00, the DCA position is worth $650.00 (gain of $150.00, or 30.00%), whereas investing the same $500.00 as a lump sum at the period 1 price of $10.00 buys 50 shares worth $500.00 ($0.00 gain).

How to use the result

Compare your average cost per share with the simple average price to see how buying more shares at lower prices lowers the weighted cost per share. Compare the DCA ending value and gain or loss against the lump-sum comparison using the exact same total amount in your currency over the same starting and ending prices.

Frequently asked questions

Why is average cost per share lower than the simple average price?

Average cost per share is lower than the simple average price whenever prices vary, because the same contribution buys more shares when prices are low. When every period price is identical, average cost per share equals the simple average price.

How is the lump-sum comparison calculated?

The lump-sum comparison assumes the entire total invested amount (X * n) buys shares at the period 1 price p_1, and then multiplies those shares by the final period price p_n.

Can fractional shares be included?

Yes. Each period divides the amount X in your currency by that period's price p_i without rounding shares down to whole numbers, matching standard fractional-share arithmetic.

How many period prices can I enter?

You must enter at least 2 period prices and up to 36 period prices, with every price and the amount per period greater than 0.

Does this calculator include dividends, trading fees, or taxes?

No. It computes only the pure price, share count, and monetary totals directly from the fixed amount per period and the prices you enter.

Want to practice these ideas without risking money? EquiTrek is an iOS app with a paper-trading simulator.

Keep reading