Dollar-Cost Averaging Calculator
Your average cost per share, gain or loss and yearly return from dated purchases, next to a lump sum at your own prices.
Results
Average cost per share
$44.75
fees included ($44.57 before fees), over 6 purchases. It is also your break-even price: above it, the holding is worth more than you paid.
- Total invested
- $3,000.006 purchases, including $12.00 of fees
- Shares owned
- 67.0399Bought at $36.50 to $52.80 a share
- Value on Jan 15, 2026
- $3,714.01At $55.40 a share
- Gain
- +$714.01+23.80% of the total invested
- Annualized return
- 30.85% a yearMoney-weighted (XIRR): each dollar was invested for 289 days on average.
- Simple average of the prices
- $45.26A fixed amount buys more shares at low prices, so they weigh more in your cost: $44.57 before fees.
Compared with one lump sum
Buying over time ends $392.22 ahead of putting $3,000.00 at once at $50.00 on Jan 15, 2025: your purchases bought 7.0799 more shares, and every share is valued at $55.40.
| Measure | Over time | Lump sum |
|---|---|---|
| Invested | $3,000.00 | $3,000.00 |
| Fees | $12.00 | $2.00 |
| Shares | 67.0399 | 59.96 |
| Value | $3,714.01 | $3,321.78 |
| Gain or loss | +$714.01 | +$321.78 |
| Annualized | 30.85% | 10.73% |
How this was calculated
- Shares bought each time = (amount − fee) ÷ price: purchase 1 (Jan 15, 2025): ($500.00 − $2.00) ÷ $50.00 = 9.96 shares; purchase 2 (Feb 18, 2025): ($500.00 − $2.00) ÷ $44.00 = 11.318182 shares; 4 more in the purchase table.
- Total shares = 9.96 + 11.318182 + … + 9.431818 = 67.03986.
- Total invested = $500 + $500 + … + $500 = $3,000.00, of which $12.00 is fees.
- Average cost per share = total invested ÷ total shares = $3,000.00 ÷ 67.03986 = $44.7495, shown as $44.75.
- Before fees = ($3,000.00 − $12.00) ÷ 67.03986 = $44.5705.
- Simple average of the prices = ($50.00 + $44.00 + … + $52.80) ÷ 6 = $45.26.
- Value = 67.03986 × $55.40 = $3,714.01.
- Gain = $3,714.01 − $3,000.00 = +$714.01, or +$714.01 ÷ $3,000.00 = +23.80%.
- Annualized return: the Internal rate of return: The discount rate that makes a project’s net present value exactly zero. It has no direct formula, so it is found by trial or with a solver, and it reads as the project’s yearly rate of return. Source: OpenStax, Principles of Finance r at which every purchase, grown for its days until Jan 15, 2026, adds up to the value: $500 × (1 + r)365/365 + $500 × (1 + r)331/365 + … + $500 × (1 + r)213/365 = $3,714.01, so r = 30.85% a year.
- Same answer in a spreadsheet: dates in A2:A8, amounts in B2:B8 with each purchase as a negative number (-500) and the value last (3714.01); =XIRR(B2:B8, A2:A8) gives 30.85%.
| Date | Price | Invested | Fee | Shares | Owned | Average cost | Value that day |
|---|---|---|---|---|---|---|---|
| Jan 15, 2025 | $50.00 | $500.00 | $2.00 | 9.96 | 9.96 | $50.20 | $498.00 |
| Feb 18, 2025 | $44.00 | $500.00 | $2.00 | 11.3182 | 21.2782 | $47.00 | $936.24 |
| Mar 17, 2025 | $36.50 | $500.00 | $2.00 | 13.6438 | 34.922 | $42.95 | $1,274.65 |
| Apr 15, 2025 | $41.00 | $500.00 | $2.00 | 12.1463 | 47.0684 | $42.49 | $1,929.80 |
| May 15, 2025 | $47.25 | $500.00 | $2.00 | 10.5397 | 57.608 | $43.40 | $2,721.98 |
| Jun 16, 2025 | $52.80 | $500.00 | $2.00 | 9.4318 | 67.0399 | $44.75 | $3,539.70 |
| Total | $3,000.00 | $12.00 | 67.0399 | $44.75 |
- Share price
- Your average cost
Chart data: Price paid and your average cost
| Date | Share price | Your average cost |
|---|---|---|
| Jan 15, 2025 | $50.00 | $50.20 |
| Feb 18, 2025 | $44.00 | $47.00 |
| Mar 17, 2025 | $36.50 | $42.95 |
| Apr 15, 2025 | $41.00 | $42.49 |
| May 15, 2025 | $47.25 | $43.40 |
| Jun 16, 2025 | $52.80 | $44.75 |
| Jan 15, 2026 | $55.40 | $44.75 |
| Price change (%) | Valuation price | Value | Gain or loss | Annualized return |
|---|---|---|---|---|
| -30% | $38.78 | $2,599.81 | -$400.19 | -16.58% |
| -20% | $44.32 | $2,971.21 | -$28.79 | -1.21% |
| -10% | $49.86 | $3,342.61 | +$342.61 | 14.62% |
| 0% (your input) | $55.40 | $3,714.01 | +$714.01 | 30.85% |
| +10% | $60.94 | $4,085.41 | +$1,085.41 | 47.46% |
| +20% | $66.48 | $4,456.81 | +$1,456.81 | 64.40% |
| +30% | $72.02 | $4,828.21 | +$1,828.21 | 81.66% |
Your purchases stay as entered (67.0399 shares for $3,000.00), valued on Jan 15, 2026. Below $44.75 a share, the holding shows a loss.
Assumptions
- Prices are the ones you entered. Nothing is looked up, so the value is only as current as the valuation price.
- Each amount is what left your account, fee included; the fee is taken out before shares are bought, and it counts in the average cost (cost basis).
- Shares are kept at full precision. Brokers round fractional shares (often to 3 to 6 decimals), so a statement can differ in the last digits.
- The annualized return counts actual days and 365-day years, like a spreadsheet’s XIRR. It is searched between −99.9% and 10,000% a year.
- No sales, stock splits, dividends, interest on uninvested cash or taxes are modeled.
- The lump sum assumes all $3,000.00 was available on Jan 15, 2025, bought at $50.00 with one fee ($2.00), and uses only the prices you entered.
- Dollar-cost averaging: Investing the same amount at regular intervals whatever the price, so each payment buys more shares when prices are low and fewer when they are high. Source: U.S. Securities and Exchange Commission, Investor.gov spreads out when you buy; it doesn’t decide whether the price rises or falls. This is an educational estimate, not investment or tax advice.
Calculated in your browser. This site doesn't send or store the numbers you enter.
What this calculator answers
You bought the same fund or stock several times at different prices. What did each share cost you on average, what is the holding worth at a price you choose, and what yearly return does that work out to, given when each dollar went in? It also answers the question behind most searches for dollar-cost averaging: would putting the same money in all at once, on your first purchase date, have done better with your prices? Nothing is looked up online; every price comes from you.
How to use it
- Enter purchases by: pick how your records look.
- Amount: one row per purchase with its date, the amount invested (everything that left your account, fee included), the price per share and the fee. Your broker’s transaction history or trade confirmations list all four.
- Shares: the date, shares bought, price per share and fee, as a statement shows whole-share or fractional lots.
- Schedule: the same amount on a regular schedule. Give the first date, how often (every week, 2 weeks, month or 3 months), the amount and fee each time, and one price per purchase. Each price shows the date it belongs to. Edit as separate purchases, under the results, turns the schedule into rows you can change one by one, for a skipped month or a one-off amount.
- Paste rows takes columns copied from a spreadsheet or a brokerage export (date, amount or shares, price, fee) and previews them, naming any cell it can’t read, before replacing or adding to your list. Rows can be in any order; they are sorted by date.
- Valuation price and valuation date: today’s price, or any price you want to test, and the date it applies to. The date can’t be before your last purchase.
- Target average cost (optional): the average per share you would like to reach by buying more at the valuation price.
Results update as you type. The Try buttons load the cases below: prices that only rise, $50 a week for 10 weeks, and a fall to $34 with a $40 target. Save for comparison keeps up to three scenarios side by side with their differences, and the purchase table downloads as a CSV file.
How to calculate your average cost per share
Divide everything you paid, fees included, by the number of shares you own. For purchases entered in dollars, each purchase first buys shares with the money left after its fee.
- is what left your account for purchase , fee included. With share counts it is shares × price + fee.
- is that purchase’s commission or transaction fee.
- is the price per share paid.
- The average before fees uses on top instead.
The value is the shares you own times the valuation price, and the gain or loss is the value minus the total invested.
Worked example: $500 a month for six months
Six purchases of $500 each, with a $2 fee taken out of each, from January to June 2025, at prices of $50.00, $44.00, $36.50, $41.00, $47.25 and $52.80. The holding is valued at $55.40 on January 15, 2026, a year after the first purchase.
- Shares each month = ($500 − $2) ÷ price. At $50.00 that is 9.96 shares; at $36.50 in March it is 13.643836.
- Total shares = 9.96 + 11.318182 + 13.643836 + 12.146341 + 10.539683 + 9.431818 = 67.03986.
- Total invested = 6 × $500 = $3,000.00, of which $12.00 is fees.
- Average cost = $3,000.00 ÷ 67.03986 = $44.75 a share. Before fees it is $2,988.00 ÷ 67.03986 = $44.57.
- Value = 67.03986 × $55.40 = $3,714.01, a gain of +$714.01, or +23.80% of what you put in.
- Annualized, the money-weighted return is 30.85% a year. It is higher than 23.80% because the average dollar was invested for 289 days, not a full year.
$44.75 is also the break-even price: above it, the holding is worth more than you paid.
Why your average cost is lower than your average purchase price
Because a fixed amount buys more shares when the price is low, the low prices carry more weight in your cost. In the example the six prices average $45.26, but the shares cost $44.57 each before fees: a fixed $498 bought 13.643836 shares at $36.50 and only 9.431818 at $52.80. With the same amount every time, your cost per share before fees is the harmonic mean of the prices, , which is never above their simple average and equals it only when every price is the same. That is the effect the Investor.gov definition describes: equal amounts buy more when the price is low and less when it is high.
When the amounts differ, or you enter share counts, the average weights each price by the shares it bought, so it can land on either side of the simple average. In the share-count example (30, 20, 25 and 10 shares), $3,750.50 bought 85 shares at $44.12 each, below the $44.96 simple average, because more shares were bought at the lower prices.
Should fees be included in your cost basis?
Yes. The IRS counts the purchase price plus costs of buying, such as commissions and transfer fees, in the basis of stock (Publication 550). That is why the headline average includes fees and the before-fees figure sits beside it: in the example, $12.00 of fees move the average from $44.57 to $44.75 a share.
The average here covers the whole holding. For taxes when you sell, the average basis method is available for mutual fund shares and certain dividend reinvestment plans; otherwise the basis is that of the specific shares you sell, or of the earliest ones if you can’t identify them (Publications 550 and 551). Your broker’s cost basis report shows which method applies.
Annualized return when you bought at different times
The total gain of 23.80% ignores that your dollars went in at different times. The annualized return here is money-weighted: it finds the one yearly rate r at which every purchase, grown for its days until the valuation date, adds up to the value.
A spreadsheet’s XIRR gives the same number: list the dates in one column and the amounts in the next, each purchase as a negative number and the value as the last, positive entry. The calculator shows the formula with your numbers and the matching =XIRR(…) line in its steps.
Two things to keep in mind:
- Short periods exaggerate. Ten weekly $50 purchases valued ten weeks after the first gain +5.09% in total, which annualizes to 59.63% a year. The calculator warns whenever the first purchase is less than a year old; the total gain is the steadier figure.
- Sometimes there is no rate to report. If every purchase is on the valuation date, no time has passed. If a price doubles or halves within a day or two, the yearly rate falls outside the solver’s search range of −99.9% to 10,000%. And if purchases made on the valuation date cost more than the whole holding is worth that day, no rate balances the amounts. The result says which case applies instead of showing a guess.
Dollar-cost averaging vs. a lump sum, using your prices
The comparison puts the same total in on your first purchase date, at your first price, paying one fee, and values it at the same price and date. In the example, $3,000.00 at $50.00 on January 15, 2025 buys 59.96 shares, worth $3,321.78 a year later (10.73%). Your monthly purchases bought 7.0799 more shares because four of the five later prices were below $50.00, so they finish $392.22 ahead.
Prices that only rise reverse it. With the Prices only rise preset ($40.00 climbing to $47.20, valued at $49.80), every later purchase paid more than the first: the lump sum is worth $3,732.51 and the monthly purchases $3,428.87, so the lump sum finishes $303.64 ahead (24.42% a year against 18.35%).
FINRA notes that holding money back in cash to invest gradually often returns less than a lump sum, especially over longer periods, while limiting the loss if prices fall soon after you start. If you invest from each paycheck, as in a 401(k), there was never a lump sum to invest, so read this comparison as a what-if about timing, not a choice you had.
How many shares to buy to lower your average
Buying more at a price below your average pulls the average down. To reach a target average A at price P, with total invested C and shares S:
With the example’s purchases valued at $34.00 instead, the holding is worth $2,279.36, a loss of $720.64 (−24.02%). Reaching a $40.00 average takes ($3,000.00 − $40 × 67.03986) ÷ ($40 − $34) = 53.0676 more shares, about $1,804.30. In whole shares, 54 for $1,836.00 give an average of $39.95.
It only works when the price is below the target. Each share bought at $34 moves the average toward $34 and never past it, so a target at or below the buying price is out of reach, and the calculator says so. A lower average doesn’t shrink the $720.64 you are down; it adds money at the same risk, and a smaller rise then gets the whole holding back to even.
Reading the result
- Average cost per share is your cost basis per share with fees, and your break-even price.
- Total invested, shares owned, value and gain or loss are for the valuation price and date you entered.
- Annualized return is the money-weighted rate, with how long the average dollar was invested.
- Simple average of the prices sits next to it, with a line on why your cost differs.
- Compared with one lump sum shows both side by side, including fees, shares and yearly rates.
- The purchase table lists each purchase by date with running shares, average cost and the value that day. When your rows were out of date order, a Row column says which row each line came from.
- The chart plots the price at each purchase and at valuation against your running average cost, with its data in a table.
- Value at other prices repeats the valuation at 10%, 20% and 30% below and above your price, so you can see where the gain turns into a loss.
What this calculator doesn’t do
- It doesn’t fetch prices, so it can’t backtest a ticker; the value is only as current as the price you type.
- Sales, stock splits, dividends, interest on cash waiting to be invested and taxes are not modeled. Adjust earlier purchases for splits yourself (see the questions below).
- Shares are kept at full precision. Brokers round fractional shares, often to 3 to 6 decimals, so a statement can differ in the last digits.
- The annualized return uses actual days over 365-day years, like
XIRR, and one valuation price for the whole holding. - It is an educational estimate, not investment or tax advice.
Common mistakes
- Entering the amount before a fee that was added on top. If $502 left your account for a $500 purchase plus a $2 fee, the amount invested is $502.
- Averaging the prices instead of the cost. The simple average of six prices ($45.26 in the example) overstates what fixed-amount buying paid per share ($44.57 before fees).
- Comparing a total return with a yearly one. +23.80% over the whole period and 30.85% a year describe the same holding; line them up with the same kind of figure elsewhere.
- Entering reinvested dividends as new money. It lowers the return you see (see the questions below).
- Mixing pre-split and post-split prices. A $80 price before a 2-for-1 split is $40 in today’s shares.
Questions
Can dollar-cost averaging still lose money?
Yes. It changes when you buy, not what the price does. If the price ends below your average cost, you have a loss however regularly you bought; try the preset where the price falls to $34. What it can do is limit the damage from a drop soon after you start, because money not yet invested isn’t affected.
How do I enter purchases made before a stock split?
Adjust them to today’s share count. After a 2-for-1 split, a purchase of 10 shares at $80 becomes 20 shares at $40. Entering by shares, double the shares and halve the price; entering by amount, halve the price and keep the amount. The cost stays the same, so the average is per post-split share and comparable with today’s price.
Should I enter reinvested dividends as purchases?
For your cost basis, yes, since the reinvested amount bought shares. For the return, no. The calculator treats every purchase as new money from you, so entering reinvested dividends counts part of your return as money you put in, which understates the gain and the annualized return. If you want both, run it twice and save each for comparison.
Does it work for crypto and fractional shares?
Yes. Shares can be any positive number, and prices below $1 are shown to 4 significant digits. Enter each buy from your exchange or broker history with the fee it charged. The calculator does not look up prices, so the valuation price is whatever you type.
Sources
- Dollar Cost Averaging (glossary) U.S. Securities and Exchange Commission, Investor.gov Dollar-cost averaging is investing equal amounts at regular intervals regardless of the market, which buys more of an investment when its price is low and less when it is high.
- The Benefits and Limitations of Dollar-Cost Averaging FINRA Spreading purchases out can limit losses in a sharp decline because the money not yet invested is unaffected, but holding cash longer often returns less than investing a lump sum, especially over longer periods; contributions from each paycheck, as in a 401(k), are dollar-cost averaging without that opportunity cost; per-transaction fees add up.
- Publication 550, Investment Income and Expenses Internal Revenue Service The basis of stock is the purchase price plus costs of purchase such as commissions; the average basis method (total basis of identical shares ÷ number of shares) for mutual fund shares and certain dividend reinvestment plan shares; the cost basis of shares bought with reinvested distributions is the amount reinvested, and dividends used to buy more shares are still reported as income; the basis of a stock split is figured like a stock dividend, spreading the old basis over the old and new shares.
- Publication 551, Basis of Assets Internal Revenue Service When you can’t identify which shares you sold, their basis is that of the shares you bought first; mutual fund shares may use an average basis.
- XIRR function Microsoft Support XIRR finds the rate at which dated cash flows net to zero, discounting on a 365-day year; it needs at least one negative and one positive value, and dates may be in any order.
- Principles of Finance, 16.3 Internal Rate of Return (IRR) Method OpenStax (Rice University) The internal rate of return is the rate that makes the present value of the inflows equal that of the outflows, found by trial and error or with a solver.
Smart Financial Calc: https://smartfinancialcalc.com/finance/dollar-cost-averaging-calculator/