Free Online Dollar-Cost Averaging Calculator
See how buying for a fixed amount every month averages your price per share.
Read articleRuns in your browser — nothing is sent
What the dollar-cost averaging calculator shows
This dollar-cost averaging calculator shows what happens when you invest the same amount every month while the price of a share moves from one level to another. You enter a monthly investment, a start price, an end price and a number of years. The calculator buys at every month's price and tells you how much you put in, how many shares you end up with, what each share cost you on average, what the holding is worth at the end price and the gain or loss.
The U.S. Securities and Exchange Commission's Investor.gov glossary defines dollar-cost averaging as investing your money in equal portions, at regular intervals, regardless of the ups and downs in the market. Because the amount is fixed, it buys more of an investment when the price is low and less when it is high. The calculator makes that effect visible and puts numbers on it.
It is a teaching tool, not a forecast. The price moves along a straight line, so it cannot show a crash, a recovery or a sideways market with swings. It is useful for questions such as "why is my average cost below the average price?", "what if the price falls while I keep buying?" and "how much does the end price matter?". Everything runs in your browser, and nothing you enter is sent anywhere.
In this guide:
- How to fill in each field and read the results, the chart and the table
- The formulas behind the numbers, and what the calculator leaves out
- Why average cost is lower than the average price, and what that does and does not mean
- Dollar-cost averaging versus a lump sum, and how often to invest
- A reference grid, three worked examples in US dollars and common mistakes
If investing on a schedule is new to you, read the dollar-cost averaging article first.
How to use the DCA calculator
The calculator opens in US dollars with a monthly investment of $500, a start price of 100, an end price of 200 and a 10-year period. The examples in this guide keep USD. The UAH / USD / EUR switch sits in the header of the Your numbers panel on wide screens and under More options on phones and tablets. Only the symbol and formatting change; nothing is converted.
Each input has a number box and a slider, in this order:
- Monthly investment. The amount you invest every month. The slider runs to 5,000 in USD or EUR and to 100,000 in UAH.
- Start price per share. The price at the moment you start, before the first purchase. The slider runs from 1 to 1,000 in every currency.
- End price per share. The price at the end of the period. The last purchase is made at this price. Same slider as the start price.
- Investment period. The number of whole years you invest.
| Input | What to enter | Default and range |
|---|---|---|
| Monthly investment | Amount invested each month | 500; 0 or more |
| Start price per share | Price when you begin | 100; at least 1 |
| End price per share | Price at the end of the period | 200; at least 1 |
| Investment period | Whole years | 10; 1 to 50 |
You can type values beyond a slider's range, such as a price of 60,000. Values outside a range are pulled back to its limit, so a price can never be below 1, and the period is rounded to whole years. Below the inputs, How it's calculated opens a note on the straight-line price and the table's Avg price column; on phones and tablets the same note sits under More options, with the currency switch. On phones, the monthly investment and the two prices use − and + buttons instead of a slider, the prices in steps of 10.
Reading the results
On wide screens the results stay in view to the right of the inputs. The headline, Portfolio value after N yrs, is the shares acquired times the end price. A bar under it splits the result: with a gain, into the total invested and the gain on top; with a loss, into the value that is left and the part that was lost, in amber. Four figures follow:
- Total invested is the monthly investment times the number of months.
- Total gain / loss is the portfolio value minus the total invested, with a plus or minus sign.
- Avg cost / share is the total invested divided by the shares acquired.
- Shares acquired is the total number of shares bought, shown with up to two decimals.
The Chart tab starts at year 0 and has three series: Total invested, Portfolio value and a dotted Share price line, which shows the price at the end of each year. The Year by year tab lists Year, Avg price, Shares bought, Total shares, Total invested and Portfolio value at the end of each year. Avg price in the table is the plain average of that year's 12 purchase prices. It is not the same figure as Avg cost / share, which weights each price by the shares it bought.
With the defaults, the headline shows $82,928, with Total invested $60,000, Total gain / loss +$22,928, Avg cost / share $144.70 and Shares acquired 414.64.
Pin to compare keeps the current inputs as a reference. The headline then shows the difference in portfolio value, as in Example 1 below, the chart adds the pinned portfolio value as a dashed line, and a Pinned scenario caption lists the pinned monthly amount, prices, period and value. Switching the currency, Reset or a reload clears it. PDF exports the inputs, the five results and the yearly table, without the pinned scenario. Share shares a link to the page without your numbers, and Reset restores the defaults, including US dollars. On phones and tablets, the results sit in a bar fixed to the bottom of the screen; Details opens the figures, the tabs and the buttons.
How the calculation works
The calculator works month by month. It sets a price for every month on a straight line, buys shares with the monthly amount at that price and adds them up.
The price path
price(k) = P0 + (P1 − P0) × k ÷ nP0is the start price per share andP1the end price per sharenis the number of months, the investment period times 12kis the month number, from 1 ton
The price changes by the same amount every month. With the defaults, the price rises by 100 over 120 months, about 0.83 a month. The first purchase is made at the end of month 1, at 100.83, not at the start price. The last purchase, in month 120, is made at exactly the end price.
Monthly purchases
shares(k) = M ÷ price(k)
total shares = shares(1) + shares(2) + … + shares(n)Mis the monthly investment
Fractional shares are allowed, so the whole amount is invested every month. Nothing is kept back as cash, and nothing is charged.
Average cost, value and gain
Total invested = M × n
Avg cost / share = Total invested ÷ total shares
Portfolio value = total shares × P1
Total gain / loss = Portfolio value − Total investedThe yearly rows follow the same rules. Portfolio value in a row is the shares held so far times the price in the last month of that year.
Assumptions behind the numbers
- A straight-line price. The price changes by a fixed amount every month, with no ups and downs along the way.
- Equal monthly purchases at month end. The amount never changes, there are no withdrawals, and no purchase is made at the start price.
- No income. Dividends and interest are not added or reinvested.
- No costs. Broker commissions, fund fees, spreads and taxes are not modelled. To include a fixed cost per purchase, enter the amount that is left after it.
- No currency conversion. All amounts and prices are in one currency.
- Rounded display. Money is shown in whole units, prices and average cost to the cent, shares to two decimals. The math itself is exact.
Why average cost is lower than average price
The best-known effect of dollar-cost averaging is that your average cost per share ends up below the average of the prices you paid. It follows from the arithmetic, not from any market behaviour.
Take $600 a month for four months, at prices of $20, $30, $15 and $20 (a simple example computed for this guide):
| Month | Price | Shares bought |
|---|---|---|
| 1 | $20 | 30 |
| 2 | $30 | 20 |
| 3 | $15 | 40 |
| 4 | $20 | 30 |
| Total | 120 |
The average price is $21.25, but you paid $2,400 for 120 shares, an average cost of $20.00. The cheap month bought twice as many shares as the expensive one, so it counts twice as much in your cost. In mathematical terms, the average cost of equal-amount purchases is the harmonic mean of the prices:
Avg cost / share = n ÷ (1 ÷ p1 + 1 ÷ p2 + … + 1 ÷ pn)The harmonic mean is never above the ordinary average, and the two are equal only when every price is the same. The more the prices vary, the bigger the gap.
That is the honest scope of the effect. It compares two ways of measuring the same purchases. It does not say that dollar-cost averaging buys more cheaply than other strategies. If the price rises steadily, a single purchase at the start would have had a lower cost per share than any series of later purchases. Read more about how prices move in the article on how stock prices are formed.
Dollar-cost averaging in rising, flat and falling markets
The calculator lets you compare markets by changing only the end price. The table uses $500 a month for 10 years and a start price of $100, so $60,000 is invested in every row. The average purchase price is computed for this guide from the same 120 monthly prices; every other figure is what the calculator shows.
| End price | Avg cost / share | Average purchase price | Portfolio value | Total gain / loss |
|---|---|---|---|---|
| $50 | $71.92 | $74.79 | $41,714 | −$18,286 |
| $75 | $86.80 | $87.40 | $51,845 | −$8,155 |
| $100 | $100.00 | $100.00 | $60,000 | $0 |
| $125 | $112.14 | $112.60 | $66,881 | $6,881 |
| $150 | $123.53 | $125.21 | $72,859 | $12,859 |
| $200 | $144.70 | $150.42 | $82,928 | $22,928 |
| $300 | $182.97 | $200.83 | $98,377 | $38,377 |
Three things follow from the model:
- The gain has the same sign as the price change. When the price only rises, every purchase is at or below the end price, so there is always a gain. When it only falls, every purchase is at or above the end price, so there is always a loss. A flat price gives exactly zero.
- The averaging effect grows with the price range. At an end price of $125 the average cost is $0.46 below the average purchase price; at $300 it is $17.86 below.
- Only the ratio of the prices matters for the value. A fall from $200 to $100 gives the same $41,714 as a fall from $100 to $50, because both halve the price. The absolute prices change only the number of shares and the cost per share.
What the straight line cannot show
The case where dollar-cost averaging helps most is a fall followed by a recovery, and a straight line cannot draw it. You can still see the effect by running the calculator twice, once for the fall and once for the recovery, and adding the shares. With $500 a month and a start price of $100:
| Price path over 2 years | Shares | Avg cost / share | Value at $100 | Gain |
|---|---|---|---|---|
| Flat at $100 | 120 | $100.00 | $12,000 | $0 |
| $100 to $80, then back to $100 | 133.89 | $89.62 | $13,389 | $1,389 |
| $100 to $60, then back to $100 | 153.3 | $78.28 | $15,330 | $3,330 |
| $100 to $50, then back to $100 | 166.46 | $72.09 | $16,646 | $4,646 |
The price ends where it started, yet the regular investor gains, because the money invested during the fall bought extra shares. A lump sum of $12,000 invested at $100 would be worth exactly $12,000 at the end of every one of these paths. The catch is that nobody knows in advance whether a fall will recover, or how long it will take, which is why regular investing works best in broad, diversified holdings. The article on risk and return explains why.
Lump sum vs dollar-cost averaging
The most common question about dollar-cost averaging is whether it beats investing everything at once. The calculator does not compare the two, but it uses the same price path you would need for the comparison. Here $12,000 is either invested at the start price or spread as $1,000 a month over one year, with a start price of $100. The lump sum figures are computed for this guide; the dollar-cost averaging figures come from the calculator.
| End price after 1 year | DCA portfolio value | DCA gain / loss | Lump sum value | Lump sum gain / loss |
|---|---|---|---|---|
| $120 | $13,028 | $1,028 | $14,400 | $2,400 |
| $110 | $12,531 | $531 | $13,200 | $1,200 |
| $100 | $12,000 | $0 | $12,000 | $0 |
| $90 | $11,429 | −$571 | $10,800 | −$1,200 |
| $80 | $10,812 | −$1,188 | $9,600 | −$2,400 |
On a straight line the result is never in doubt: the lump sum wins whenever the price rises and loses whenever it falls. Spreading the purchases cuts both the gain and the loss over the year to about half or a little less. Which approach is better therefore depends on how often markets have risen over short periods.
Vanguard studied exactly this. In Cost averaging: Invest now or temporarily hold your cash? (February 2023), it compared investing a lump sum in global stocks with splitting it into three equal parts a month apart, using MSCI World Index returns for 1976 to 2022 and measuring wealth after one year:
- The lump sum came out ahead 68% of the time.
- Cost averaging beat keeping the money in cash 69% of the time.
- With interest on the cash waiting to be invested, the lump sum still won 65% of the time.
- The longer the money is spread out, the greater the cost of waiting.
The paper concludes that most investors, particularly those without significant aversion to loss, should invest a lump sum immediately, while cost averaging may suit people so worried about losses that they would otherwise leave the money in cash. Past results do not guarantee future ones.
This research is about money you already have. Most people invest from income, a little every month, and for them dollar-cost averaging is not a choice between strategies; it is simply how the money arrives. The investment goal calculator helps decide how much to invest each month.
What a linear price path means
The calculator's straight line adds the same amount to the price every month. Real investments that grow tend to compound instead: they rise by a percentage, so the amount added grows over time. A linear path therefore has a falling growth rate. With the defaults, a price going from 100 to 200 over 10 years rises like this:
| Year | Price at start of year | Price at end of year | Rise in the year |
|---|---|---|---|
| 1 | 100 | 110 | 10.00% |
| 2 | 110 | 120 | 9.09% |
| 3 | 120 | 130 | 8.33% |
| 5 | 140 | 150 | 7.14% |
| 8 | 170 | 180 | 5.88% |
| 10 | 190 | 200 | 5.26% |
The yearly rise falls from 10% to just over 5%. A doubling in 10 years corresponds to a steady rate of about 7.18% a year (computed for this guide as 2 to the power 0.1, minus 1). Compared with that steady rate, the straight line rises faster in the early years and slower in the later ones. Every purchase between the start and the end therefore happens at a higher price than on a compounding path with the same start and end prices, and the calculator's average cost comes out a little higher.
The practical message is to use the calculator for the logic of averaging, not to estimate returns. If you want to know what a steady percentage return does to regular deposits, use the compound interest calculator, which works with a rate instead of prices.
How often to invest: daily, weekly or monthly
The calculator buys once a month, which matches how most people are paid. Brokers often allow weekly or even daily automatic purchases, and people ask which is best.
For the average cost, the frequency matters little over long periods. Weekly and monthly purchases cover nearly the same range of prices, so their averages end up close together. Over a few months, a more frequent schedule spreads the purchases over more prices, which can smooth the result slightly, but it cannot change the overall direction of the market.
Costs matter more. If your broker charges a fixed fee per purchase, more frequent buying multiplies it. Here is the yearly fee on the same yearly amount (simple arithmetic for this guide):
| Monthly budget | Fee per purchase | Monthly purchases | Weekly purchases |
|---|---|---|---|
| $100 | $1 | $12 (1.0%) | $52 (4.3%) |
| $100 | $5 | $60 (5.0%) | $260 (21.7%) |
| $500 | $1 | $12 (0.2%) | $52 (0.9%) |
| $500 | $5 | $60 (1.0%) | $260 (4.3%) |
The percentage is the share of a year's investments lost to fees before any return. With small amounts and fixed fees, investing less often, monthly or even quarterly, is cheaper. With commission-free fractional purchases, choose whatever schedule you can keep up automatically. If money for a lump sum sits idle while you spread it out, the Vanguard finding above applies: the longer the spreading period, the more time in the market you give up.
DCA with stocks, ETFs and crypto
Dollar-cost averaging works the same way with anything you can buy in regular amounts. What changes is how much the price swings and how you enter it.
| Situation | How to enter it | What to keep in mind |
|---|---|---|
| Broad index ETF | Fund price per unit | One purchase spreads money across many companies |
| Single stock | Share price | One company's risk stays undiversified |
| Very high price, such as a whole coin | Price per coin | Shares acquired shows only two decimals |
| Price below 1 | Price per 100 or 1,000 units | Read Shares acquired in the same bundles |
| Price falls to zero | Not possible; the minimum is 1 | A real investment can lose everything |
A broad index ETF is the most common choice for a regular plan, because one purchase buys a slice of a whole market. The article on what indices are explains how such funds follow an index, and types of investment assets compares stocks, bonds, funds and other options.
For crypto, the averaging works the same, but prices can move tens of percent in a month. A straight line from one price to another hides almost all of that path, so treat the result as a rough illustration. Example 3 below shows how to handle a very high price.
Dollar-cost averaging at a glance
This grid shows the portfolio value after investing $500 a month from a start price of $100, for different end prices and periods. Every value comes from the calculator.
| End price | 5 years | 10 years | 20 years | 30 years |
|---|---|---|---|---|
| Total invested | $30,000 | $60,000 | $120,000 | $180,000 |
| $50 | $20,920 | $41,714 | $83,303 | $124,892 |
| $80 | $26,827 | $53,604 | $107,159 | $160,713 |
| $100 | $30,000 | $60,000 | $120,000 | $180,000 |
| $120 | $32,768 | $65,586 | $131,222 | $196,857 |
| $150 | $36,367 | $72,859 | $145,843 | $218,826 |
| $200 | $41,340 | $82,928 | $166,106 | $249,283 |
| $300 | $48,941 | $98,377 | $197,251 | $296,126 |
Read down a column to see how much the end price matters, and across a row to see the effect of time. Along a straight line the average cost barely depends on the period: from $100 to $200 it is $145.14 over 5 years and $144.41 over 30. The value grows with the period mostly because more money goes in, not because the averaging improves.
Worked examples
Each example uses USD and shows what the calculator returns.
Example 1: $300 a month into an index fund for 20 years
Given: Monthly investment $300, Start price per share $50, End price per share $150, Investment period 20 years.
Steps:
- Select USD and enter 300, 50, 150 and 20.
- Read the headline and the figures, then open the Year by year tab.
- Click Pin to compare, then change the end price to 100, 50 and 40. At 100 the headline reads −$18,688 vs pinned.
Result: Total invested $72,000, Shares acquired 789, Avg cost / share $91.25, Portfolio value $118,351, Total gain / loss $46,351.
| Year | Avg price | Shares bought | Total shares | Portfolio value |
|---|---|---|---|---|
| 1 | $52.71 | 68.35 | 68.35 | $3,759 |
| 5 | $72.71 | 49.53 | 290.94 | $21,820 |
| 10 | $97.71 | 36.85 | 497.57 | $49,757 |
| 20 | $147.71 | 24.37 | 789 | $118,351 |
The same $300 buys 68.35 shares in year 1 but only 24.37 in year 20. With an end price of $100 the value is $99,663, at $50 it is exactly the $72,000 invested, and at $40 it is $64,295, a loss of $7,705. The average cost of $44.79 in that last case is below the start price, but still above the end price.
Example 2: Investing through a fall and a recovery
Given: $1,000 a month. The price falls from $80 to $60 over 3 years, then recovers to $80 over 2 years. The calculator needs one run for each stretch.
Steps:
- Select USD and enter 1000, 80, 60 and 3. Note the results.
- Enter 1000, 60, 80 and 2. Note the results.
- Add the shares acquired and the totals invested from both runs, and value all the shares at $80.
Result: The first run shows Total invested $36,000, Shares acquired 519.92, Avg cost / share $69.24, Portfolio value $31,195 and Total gain / loss −$4,805. The second run shows $24,000 invested, 343.14 shares, $69.94 per share, $27,451 and a gain of $3,451.
Together, $60,000 bought 863.06 shares, an average cost of $69.52. At $80 they are worth $69,045, a gain of $9,045. Running the calculator for 5 years with the price flat at $80 shows $60,000 invested, 750 shares and no gain at all.
The loss of $4,805 after three years was the low point of the plan, and it was the period that later produced most of the gain: the 519.92 shares bought during the fall are worth $41,593 at $80. Stopping the plan during the fall would have locked in the loss instead.
Example 3: A high-priced crypto coin
Given: Monthly investment $250, Start price per share $60,000, End price per share $90,000, Investment period 4 years.
Steps:
- Select USD and enter 250, 60000, 90000 and 4.
- Read the results, then change the end price to 40000.
- For more precision, enter the prices per thousandth of a coin, 60 and 90, and divide the shares by 1,000.
Result: Total invested $12,000, Shares acquired 0.16, Avg cost / share $74,306.35, Portfolio value $14,534, Total gain / loss $2,534. With an end price of $40,000 the value is $9,773, a loss of $2,227.
The share count is rounded to two decimals, so 0.16 hides the detail. Entering 60 and 90 gives Shares acquired 161.49 and an average cost of $74.31, which means about 0.16149 coins at about $74,310 each; the first run's $74,306.35 is the exact figure. The value and gain stay the same. Real crypto prices rarely move in a straight line over four years, so this shows the mechanics, not a likely outcome.
Common mistakes with dollar-cost averaging
- Reading the average cost as a bargain. An average cost below the average price is arithmetic, not a discount compared with other strategies. In a rising market, earlier and larger purchases would have cost less.
- Expecting DCA to prevent losses. If the price ends below your average cost, you lose money. The $100 to $50 path above loses $18,286 on $60,000.
- Stopping during a fall. The months with low prices buy the most shares. Pausing then gives up the part of the plan that benefits most from a recovery.
- Spreading a windfall over a long time. With a lump sum available, long spreading periods have usually cost more than they saved, according to the Vanguard study above.
- Treating the straight line as a forecast. The end price is your assumption. The calculator shows the effect of that assumption, not what will happen.
- Ignoring fees per purchase. A $5 fee on a $100 monthly purchase takes 5% of every contribution before any return. Choose low-cost instruments; the fees drag calculator shows how yearly fund fees add up.
- Forgetting the currency. The calculator opens in US dollars. If you invest in euros or hryvnias, switch the currency first; nothing is converted either way.
- Comparing Avg price with Avg cost / share. The table's Avg price is the plain average of a year's prices. The Avg cost / share figure weights each price by the shares it bought.
The results are illustrations of a price path you choose, not forecasts or financial advice. Investments can lose value, and investing regularly does not guarantee a profit.
Limitations and next steps
The dollar-cost averaging calculator answers one question clearly: if you invest a fixed amount every month while the price moves in a straight line, what does each share cost you and what is the holding worth at the end? It does not know real prices, and it cannot model swings, crashes, dividends, fees, taxes, a changing monthly amount, inflation or interest on cash waiting to be invested. It also does not compare dollar-cost averaging with a lump sum; the comparisons in this guide were added by hand.
Use it to understand the mechanics, then look at the parts it leaves out:
- The compound interest calculator projects regular deposits at a steady percentage return.
- The investment goal calculator works out the monthly amount needed for a target.
- The inflation impact calculator shows what a future amount is worth in today's money.
- The fees drag calculator shows how fund fees reduce long-term results.
For background, read what investing is and the dollar-cost averaging article. For decisions about your own money, accounts or taxes, consider a qualified, independent financial adviser who can take your full situation into account.
Frequently asked questions
Short answers to common questions about dollar-cost averaging, lump-sum investing and how this DCA calculator works.