Average cost calculator
Bought the same stock, coin or gold at different prices? Enter each purchase to see your average cost per unit, the total quantity, everything you paid including commission and your break-even price. You can also add partial sales, compare the average with a current price and see how one more purchase would change it.
Average cost 45.55Quantity held 275Break-even price 45.64
Used for every row and for the break-even price. Leave 0 if there is none.
Purchases and sales
Rows are applied from top to bottom, in the order the trades happened.
Current price (optional)
Type it in, or fill it from the list.
Average cost
45.55per unit
Average price (no commission): 45.45
275 units at an average cost of 45.55. Total paid 12,525; break-even at 45.64.
- Quantity held
- 275
- Total paid
- 12,525
- Total commission
- 25
- Break-even price
- 45.64
- Market value
- 12,650
- Value after selling commission
- 12,624.70
- Unrealized P/L
- +99.70
- +0.8%
- Price vs average cost
- +1%
After the commission for selling at this price
Selling everything above 45.64 returns more than these units cost, after commission.
Effect of one more purchase
Shows how one more purchase would change the average. It shows the arithmetic, not whether to buy.
- New average cost
- 45.69
- Change in average
- +0.32%
- New quantity
- 375
- New cost of units held
- 17,134.20
- New break-even price
- 45.78
- Distance from 46 to the new break-even
- -0.47%
New average at other purchase prices
For the quantity (or amount) above, at purchase prices from 30% below to 30% above 46.
| Purchase price | New average cost | Change in average |
|---|---|---|
| 32.20 -30% | 42 | -7.78% |
| 36.80 -20% | 43.23 | -5.08% |
| 41.40 -10% | 44.46 | -2.38% |
| 46 0% | 45.69 | +0.32% |
| 50.60 +10% | 46.92 | +3.02% |
| 55.20 +20% | 48.15 | +5.72% |
| 59.80 +30% | 49.38 | +8.42% |
For information only — not investment advice.
How the average cost is calculated
Each purchase adds its quantity and its cost, commission included. The average cost is the total cost divided by the total quantity:
Formula
- Cost of a purchase = quantity × price × (1 + commission)
- Average cost = total cost of the purchases ÷ total quantity
- Average price (without commission) = Σ (quantity × price) ÷ Σ quantity
- Break-even price = average cost ÷ (1 − commission)
- Unrealized P/L = quantity × current price × (1 − commission) − cost of the units held
If you enter amounts instead of quantities, a purchase amount is everything paid, commission included: quantity = amount ÷ (price × (1 + commission)). For a sale it is what you received after commission: quantity = amount ÷ (price × (1 − commission)).
Worked example
You buy 100 shares at $50, then 50 at $40 and 125 at $44, paying a 0.2% commission each time.
Example
- Purchases: 100 × $50 + 50 × $40 + 125 × $44 = $12,500
- Commission: $12,500 × 0.2% = $25
- Total paid: $12,500 + $25 = $12,525
- Average cost: $12,525 ÷ 275 = $45.55
- Break-even price: $45.55 ÷ 0.998 ≈ $45.64
At a price of $46, the 275 shares are worth $12,650; after the commission for selling, that is $99.70 (0.8%) more than they cost. The simple average of the three prices is $44.67, but the average cost is $45.55, because more shares were bought at some prices than at others.
Selling part of a position
The calculator uses the average cost method. A sale takes units out at the current average cost: the quantity falls, the average stays the same, and the difference between what the sale brings in and that cost is the realized profit or loss. Rows are applied in order, so enter a sale where it happened between purchases.
Formula
- Cost removed = units sold × average cost
- Realized P/L = units sold × sell price × (1 − commission) − cost removed
- Average cost after a sale = average cost before it
In the example above, selling 100 shares at $48 realizes $236; the remaining 175 shares keep the $45.55 average.
Some brokers and tax rules match each sale against the oldest purchase instead (first in, first out, or FIFO). Under FIFO the average of what remains can change after a sale, so the figures here can differ from a FIFO-based statement.
How one more purchase changes the average
The table adds 100 shares to the example position at prices from 30% below to 30% above $46. It shows the arithmetic of a purchase, not whether to make one.
| Purchase price | New average cost | Change in average |
|---|---|---|
| $32.20 -30% | $42 | -7.78% |
| $36.80 -20% | $43.23 | -5.08% |
| $41.40 -10% | $44.46 | -2.38% |
| $46 0% | $45.69 | +0.32% |
| $50.60 +10% | $46.92 | +3.02% |
| $55.20 +20% | $48.15 | +5.72% |
| $59.80 +30% | $49.38 | +8.42% |
A purchase below the current average lowers it and one above raises it. How far it moves depends on the size of the new purchase compared with what is already held.
Good to know
- The average cost includes buy commissions; the average price without them is shown next to it.
- The break-even price assumes everything is sold at one price with the same commission rate. Taxes, spreads and transfer fees are not included.
- Use one currency in every row: if you bought US shares in dollars, enter dollar prices. A filled-in price shows the currency it is quoted in.
- Splits and bonus issues change the quantity and the price per share; enter earlier purchases in post-split terms.
- What you type stays in this browser tab: it is not saved, not added to the page address and not sent to our servers.
Frequently asked questions
How do I calculate my average cost per share?
Add up what you paid for each purchase, commission included, and divide by the total number of shares. 100 shares at 50 and 50 shares at 40 cost 7,000 for 150 shares, an average cost of 46.67 before commission.
Does selling some shares change my average cost?
Not under the average cost method: a sale removes shares at the current average, so the quantity falls and the average stays the same, while the gain or loss on the shares sold is realized. Under first in, first out (FIFO), which some brokers and tax rules use, the average of the remaining shares can change.
What is the break-even price?
The price at which selling the shares you hold returns exactly what they cost after commission: average cost ÷ (1 − sell commission). With an average cost of 50 and a 0.2% commission, it is 50 ÷ 0.998, about 50.10.
Can I use it for crypto or gold?
Yes. Enter coin amounts or grams as the quantity and prices in the currency you paid. You can also fill in the latest stored price for gram gold, major coins, lira exchange rates and tracked stocks.
Is the average cost the same as the average of the prices?
No. A simple average counts every purchase equally, while the average cost weights each price by the quantity bought and can include commissions. Buying 100 shares at 50 and 10 at 40 gives a simple average of 45 but an average cost of 49.09 per share.