Updates automatically as you type.
Calculated in your browser; your inputs are not sent to us. Privacy
Calculation details
Planning estimate only, not financial, tax, or legal advice. Verify assumptions and current rules before making decisions.
This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.
Use this result
Share the current inputs or ask ChatGPT to explain the calculation in context.
More options
What does this calculator estimate?
Buying 100 shares at $20 and 50 more at $30 gives a $3,500 cost basis across 150 shares: an average cost of $23.33 per share. At a $28 current price the position is worth $4,200, an unrealized gain of $700. Enter each buy in the BoringToolsKit stock average cost calculator to see your true break-even price.
- Average cost is total dollars invested divided by total shares, not the average of your entry prices. (Source: BoringToolsKit calculation methodology)
- The IRS allows the average cost basis method for mutual fund shares; single-stock sales default to specific identification or FIFO. (Source: IRS)
- Unrealized gains are paper gains: tax is only owed when shares are sold. (Source: IRS)

Averaging the prices instead of the dollars is the classic error
The most common mistake with lots bought at different prices is averaging the entry prices. Two buys, 100 shares at $20 and 50 shares at $30, produce an entry-price average of (20 plus 30) divided by 2, which is $25. The calculator returns $23.33, and the gap between those numbers is the whole point: average cost is total dollars divided by total shares, or (2,000 plus 1,500) divided by 150. The $20 lot contains twice as many shares, so it pulls the weighted average below the midpoint.
Getting this wrong by $1.67 per share sounds small until it is multiplied by everything you own. On 150 shares it is a $250 error in your own mental break-even. Worse, the simple price average always sits at the midpoint, so it hides the fact that your position is skewed toward whichever lot you bought more of. If you DCA'd more money at the bottom, your real average is meaningfully lower than the midpoint suggests, and only the weighted calculation shows it. Enter the share counts for every buy and let the division do the weighting.
What selling part of a position does to the average
Under the average cost method, every share sold carries the same basis: the current average. From the 150-share example at a $23.33 average, selling 50 shares at $28 realizes a gain of (28 minus 23.33) times 50, or about $233, and leaves 100 shares still carried at $23.33. The average of what remains does not change because each dollar of basis is spread evenly across every share.
That evenness is also a limitation. Specific identification or FIFO would let you choose which lot the 50 shares came from, and the realized gain changes with that choice: selling from the 100-share $20 lot first realizes a $400 gain, roughly $167 more than the average basis produces. Which figure actually appears on your tax filing depends on the method in place at your broker, not on the arithmetic on this page. Use the calculator to know your break-even and position size with precision, then check the lot-level detail in your brokerage account before you assume you know what a partial sale realizes. Run the page for the break-even and the shares, then read the lot detail before you book the gain.
Averaging down in dollars, not in feelings
Run the position you already hold: 100 shares at $40 for a $4,000 basis, price now $30. Buying 100 more shares costs $3,000 and moves the average to (4,000 plus 3,000) divided by 200, or $35. Your break-even falls from $40 to $35, which shrinks the required rise to get back to even from 33.3% to about 16.7%. That manipulation of the break-even is exactly why averaging down is popular.
What the same numbers say about risk is less flattering. Your dollar exposure has gone from $4,000 to $7,000, and if the price falls again from $30 to $25 the unrealized loss is $2,000 instead of the $1,500 you would have carried without adding. The calculator describes neither future; it prices the position as you enter it. The honest frame is that averaging down is a decision to put more money at risk in exchange for a lower break-even, and the two numbers above are the actual size of that trade. If the extra $3,000 would change how you feel about a further decline, that is the thing to settle before the buy, not after.
Taxes on sales are outside this calculation
The average cost this page computes is a bookkeeping number. It says what each share has cost you in total dollars, and nothing else. When shares are sold, what matters for money actually received is proceeds minus basis minus tax, and tax treatment depends on facts the calculator never sees: the lot method on file with your broker, how long shares were held, and the account they sit in.
Two specifics worth knowing. First, the IRS accepts average cost for mutual fund shares, while positions in individual stocks generally default to FIFO or specific identification unless another method is elected, so an average-cost figure on a stock may not match your brokerage's realized-gain report. Second, holding period runs lot by lot, which average basis deliberately ignores: a buy made 15 months ago and one made 3 months ago share an average but not a holding period. This page is the right tool for break-even and for sizing a partial sale in shares; the tax figure belongs to your broker's lot detail or a tax professional. Treat this page and the brokerage lot report as two different questions about the same position, and keep both open when a sale is in the picture.

How this calculator works
Formula
Average cost = (shares1 x price1 + shares2 x price2) / total shares.
Frequently asked questions
What is a stock average calculator and how does it work?
A stock average calculator helps you compute the average cost per share of a stock you have purchased multiple times at different prices. You simply enter each buy transaction's share count and price, and the tool instantly calculates your weighted average cost basis.
Do I need to create an account or sign up to use this tool?
No. This is a fully no-signup, browser-based tool. All calculations are performed locally on your device, your data never leaves your browser and is never stored on any server.
Is the stock average calculator free and accurate?
Yes, the tool is completely free to use and calculates your average cost using a precise weighted-average formula based on the number of shares and purchase prices you enter. It is designed to be a reliable reference for personal investment tracking.
Cite this tool
BoringToolsKit. “Stock Average Cost Calculator.” boringtoolskit.com/stock-average-cost-calculator/. Free to reference in articles, syllabi, and answer posts with a link.
Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.