Average cost calculator for stocks
Add every purchase, one row per buy. The calculator divides the total you paid, fees included, by the total shares to give your average cost per share. Enter the current price to see profit or loss as well. Everything is calculated in your browser.
Free app that keeps every buy and dividend you enter and shows the average cost and cost basis of each holding, without linking a brokerage account, for iPhone and Android.
More about LiteFolioCalculate your average cost
Result (currency units)
| Average cost per share (fees included) | |
|---|---|
| Average cost per share (fees excluded) | |
| Total shares | |
| Total invested (fees included) | |
| Total fees | |
| Market value | |
| Profit / loss | |
| Return |
Amounts are in the same currency units you entered; no currency symbol is added. Fees are added to the total you paid before dividing by the shares.
Formulas and a worked example
The average cost is the total you paid divided by the total number of shares, not the plain average of the prices. A larger purchase counts for more.
| Item | Formula | Example |
|---|---|---|
| Total invested | Σ (shares × price) + fees | 100 × 50 + 50 × 80 + 10 = 9,010 |
| Average cost per share | total invested ÷ total shares | 9,010 ÷ 150 = 60.07 |
| Market value | total shares × current price | 150 × 70 = 10,500 |
| Return (%) | (market value − total invested) ÷ total invested × 100 | (10,500 − 9,010) ÷ 9,010 × 100 = 16.54% |
Example: 100 shares at 50 with a fee of 5, then 50 shares at 80 with a fee of 5, and a current price of 70. The plain average of the two prices would be 65, but the weighted average is lower because more shares were bought at 50.
LiteFolio keeps every buy, sell and dividend in one timeline and works out your average cost and dividend income for each holding, with no brokerage connection.
More about LiteFolioFAQ
How do I calculate the average cost of shares bought at different prices?
Multiply the shares by the price for each purchase, add them up, add any fees, then divide by the total number of shares. For 100 shares at 50 and 50 shares at 80: (100 × 50 + 50 × 80) ÷ 150 = 9,000 ÷ 150 = 60. This is a weighted average, so it is not the same as (50 + 80) ÷ 2 = 65.
Are fees included in the average cost?
This calculator adds the fees you enter to the amount paid, because many brokers and tax rules count commissions as part of the cost of a purchase. Both the fee-inclusive and the fee-exclusive averages are shown. How fees are treated for tax differs by country, so follow your broker's statement or your tax authority.
What happens to my average cost after a stock split or a partial sale?
In a split, the number of shares is multiplied and the price per share divided by the same ratio, so your total invested stays the same and the average cost per share falls by that ratio: a 2-for-1 split turns an average of 60 into 30. Under the average-cost method a partial sale reduces shares and total cost in proportion, so the average per share does not change; some countries instead require FIFO or specific lots, so check which rule applies to you.
Is my average cost the same as my break-even price?
Almost. If the average cost already includes the buying fees, the break-even price is that average plus the selling fees and any tax per share. A current price above the average cost means the position shows a gain before selling costs; below it, a loss.
More tools
Keep your numbers in one place
LiteFolio is a free portfolio tracker for iPhone and Android: record stocks, ETFs, trades and dividends yourself and see average cost, cost basis, profit and dividend income per holding.
More about LiteFolio