How to use the average price calculator
- Pick a method at the top. Buy more is for when you know how many to buy, Spend an amount for when you know your budget, and Hit a target for when you have a goal average price.
- Enter how many you hold and your average buy price.
- Enter the price now, which is the price you'd buy more at.
- In the last box, enter the quantity to buy, the amount you can spend, or the target average, depending on the method you chose.
The result appears as soon as the boxes are filled and updates when you change a value. Tap Try an example if you're not sure where to start. You can copy the result, share it, save it as a CSV file, or print it to PDF. Prices can be in any currency as long as they match; the labels next to the boxes can be changed under "Choose units".
What is an average price (cost basis)?
Your average price is the average per-unit cost of a stock or crypto position you bought in several purchases. Add up everything you paid, then divide by the number of units you own. Buying more after a price drop to lower that average is often called averaging down; buying more after a rise is averaging up.
| Price you buy at | New average | Return at that price |
|---|---|---|
| $90 | $95.00 | −5.26% |
| $80 | $90.00 | −11.11% |
| $70 | $85.00 | −17.65% |
| $50 | $75.00 | −33.33% |
Buying the same quantity puts the new average halfway between the two prices. If the quantities differ, it leans toward the larger purchase. Fees and taxes are not included.
The formulas
Nothing is rounded during the calculation; it uses exact fractions and rounds only for display, to 2 decimal places (or more if your prices are more precise).
- New average price = (quantity held × your average + quantity added × price added) ÷ (quantity held + quantity added)
- Extra quantity needed = quantity held × (your average − target) ÷ (target − price added)
- Quantity your budget buys = budget ÷ price now (rounded down to a size you can buy; leftover money is shown)
- Return = price now ÷ average price − 1
- If the extra quantity doesn't come out even, it is rounded up: to 1 unit for whole shares, or to 8 decimal places for fractional amounts such as crypto, so your average lands on the target or slightly past it.
Worked examples
- 10 shares at an average of $100, buy 10 more at $80 → new average $90.00 (20 shares, $1,800 in total)
- 10 shares at $100, buy 30 more at $80 → new average $85.00 (it leans toward the larger purchase)
- 100 shares at $52, buy 100 more at $47 → new average $49.50
- 20 shares at $50, buy 20 more at $40 → new average $45.00
- 10 shares at $100, spend $1,000 at $80 → buys 12 shares ($960) with $40 left over; new average about $89.09
- 10 shares at $100, buying at $80 to reach a $90 average → 10 more shares ($800)
- 100 shares at $52, buying at $47 to reach a $50 average → 66.67 shares, rounded up to 67 more ($3,149), for a new average of $49.99
When it helps
- Checking what your average becomes before you buy more of a stock or coin
- Finding how much more you'd have to spend to bring your average down to a chosen price
- Combining several separate purchases into one average price
Frequently asked questions
How do you calculate an average price?
Add up everything you paid and divide by the total quantity. If you bought 10 shares at $100 and 10 more at $80, the average is ($1,000 + $800) ÷ 20 = $90. In the calculator, enter the quantity held, your average price, the price now, and how many more to buy (or your budget).
Does averaging down reduce my losses?
It lowers your average, so the gain needed to break even gets smaller. If your average is $100 and the price is $80, you need +25% to break even; after buying 10 more and reaching a $90 average, +12.5% is enough. But it doesn't erase a loss you already have, and if the price keeps falling, a bigger position means bigger losses. This calculator doesn't recommend buying; it only does the math.
How many more shares do I need to hit a target average?
Choose "Hit a target" and enter the average you want. The formula is quantity held × (your average − target) ÷ (target − price added). With 100 shares at $52, buying at $47 to reach $50: 100 × 2 ÷ 3 = 66.67, so you'd buy 67 more.
What if I only know my budget?
Choose "Spend an amount" and enter what you can spend. You buy budget ÷ price now (rounded down to whole shares), and the calculator shows what's left over and your new average. If the budget is less than one unit's price, it tells you nothing can be bought.
My target average won't calculate. Why?
The target has to sit between your average and the price you buy at. An average only moves between those two prices, so no amount of buying can push it below the price you're buying at. When it's out of range, the page shows the range that works.
Does it work when the price has gone up?
Yes. If the price you buy at is higher than your average, your average rises, and the result says so. In "Hit a target" mode it also finds the quantity needed to move your average up to a higher target.
Can I enter fractional quantities, like crypto?
Yes. Quantities can have up to 12 decimal places. When the quantity needed for a target is rounded up, fractional quantities round to 8 decimal places and whole quantities round to 1 unit.
Why might this differ from my brokerage's average cost?
This calculator is a pure price average without fees or taxes. Brokerages differ in whether they include fees, how they round, and how they treat currency exchange on foreign stocks, so the figure in your app can be slightly different.
How do I use it for foreign stocks?
Enter prices in the original currency, the same for every box. The exchange rate changes with every purchase, so this calculator doesn't convert to your home currency. If you want a home-currency view, enter each purchase's converted price instead.
Are my numbers stored?
No. Everything is calculated inside your browser. Nothing you type is sent to a server or saved.
What are the limits?
Quantities and prices must each be above 0 and below 1 quadrillion, with up to 12 decimal places. If a value is out of range or isn't a number, the page tells you why and how to fix it.
Last updated 2026-12-02 · Calculation version average-price-v2 · For reference only; not investment, tax or legal advice.