Free stock average cost calculator
Calculate the average cost per share after multiple purchases — enter share counts and prices to find your average cost basis, updated live, as you type.
On this page10 sections
For informational purposes only. Not investment advice. Gains/losses shown before taxes.
Results are estimates. Consult a professional.
How the stock average cost calculator works
When you buy shares of the same stock at different prices over time — a strategy called dollar-cost averaging (DCA) — your average cost per share is simply the total amount invested divided by the total number of shares purchased. This single number tells you the break-even price: the stock must trade above your average cost for your overall position to be profitable.
The average cost method is also the default tax-lot accounting method for mutual funds and is widely used for brokerage accounts. Knowing your average cost basis helps you calculate capital gains or losses when you sell, and tells you whether adding shares at the current price will raise or lower your break-even.
Worked example: two purchases at different prices
Taylor buys 100 shares of a stock at $50 per share for a total of $5,000. Two months later the stock dips and Taylor buys an additional 150 shares at $40 per share ($6,000). What is the average cost per share across both purchases?
Dollar-cost averaging scenario: four purchases
The table below shows a running average cost calculation across four purchases of the same stock. Notice how buying more shares at lower prices pulls the average down, while buying at higher prices pushes it back up.
| Purchase | Shares Bought | Price | Amount Invested | Total Shares | Running Avg Cost |
|---|---|---|---|---|---|
| 1 | 100 | $50.00 | $5,000 | 100 | $50.00 |
| 2 | 150 | $40.00 | $6,000 | 250 | $44.00 |
| 3 | 80 | $55.00 | $4,400 | 330 | $46.06 |
| 4 | 120 | $45.00 | $5,400 | 450 | $45.78 |
Source: Average cost per share formula — running total invested ÷ running total shares. Brokerage commissions excluded for clarity.
Tips for tracking and using average cost
Knowing your average cost per share is useful for planning entries, exits, and tax reporting. These tips help you use it correctly in each context.
- Use average cost to set realistic profit targets — Your break-even is the average cost, not the price of your first purchase. If you've been averaging down, your target may be much lower than you think, making a return to profit faster.
- Confirm your broker's cost-basis method — Brokers default to different lot-tracking methods (average cost for mutual funds, FIFO for stocks in many cases). The IRS requires you to specify your method before selling; mismatches can create unexpected tax bills.
- Averaging down in falling stocks is a double-edged sword — Buying more of a declining stock lowers your average cost but increases your total exposure. Ensure the reason for the decline is temporary (market-wide) rather than fundamental to the company.
- Re-check after corporate actions — Stock splits, reverse splits, spin-offs, and return-of-capital dividends all adjust your cost basis. Your brokerage should track these automatically, but verify after any corporate action.
- Export purchase history for tax documentation — Keep a running log of every purchase (date, shares, price, commissions) even if your broker tracks it. This data is essential for calculating capital gains — especially if you switch brokers, who may not inherit your historical cost basis.
Accuracy and limitations
This calculator uses the average cost basis method — total dollars invested divided by total shares — which is mathematically exact for the inputs provided. It does not apply FIFO, LIFO, or specific-lot accounting, which can produce materially different cost bases and tax outcomes when you sell only some of your shares. The calculator also does not account for brokerage commissions (which are typically added to cost basis), dividend reinvestment, return-of-capital distributions, or corporate actions such as stock splits. For authoritative cost-basis figures for tax reporting, use your brokerage's official statements.
Not financial advice — consult a financial professional for your specific situation.
Key terms for average cost and DCA
About this stock average cost calculator
This calculator runs entirely in your browser — nothing you enter is sent to any server.
Part of our finance calculators suite — explore all calculators.