Stock Average Cost Calculator
Combine several purchases and sales into one average cost per share and see your profit at today's price.
Stock Average Cost Calculator
Transactions (in order)
Average Cost per Share
—
Shares Held
—
Cost Basis (remaining)
—
Current Value
—
Unrealised P&L
—
Unrealised Return
—
Realised P&L
—
Total P&L
—
Average cost vs. current price
Transaction History and Running Average
| # | Type | Qty | Price (₹) | Fees (₹) | Shares held | Avg cost (₹) | Realised P&L (₹) |
|---|
Sells reduce your shares at the running average cost, so they do not change the average cost per share.
Assumptions & method
- Method: weighted average cost. On a buy, cost basis increases by quantity × price + fees, and average cost = cost basis ÷ shares held.
- On a sell, shares are removed at the current average cost (not first-in-first-out or specific lot). The average cost per share stays unchanged after a sale.
- Realised profit or loss on a sale = quantity × sell price − sell fees − quantity × average cost at that moment. Fees are entered as a total rupee amount per transaction.
- Unrealised profit or loss = shares held × (current price − average cost). Break-even for the remaining shares is the average cost, before any future sell fees.
- Transactions are processed in the order listed, and you cannot sell more shares than you hold at that point. Splits, dividends and taxes are not included; adjust quantities and prices for splits first.
- Buy fees are treated as part of the cost, which is common for cost-basis tracking. Your local rules for cost basis may differ.
Results are estimates based on the figures you enter. They are not guarantees and not financial advice.
What is average cost?
When you buy the same stock at different prices, your overall entry point is the weighted average of those purchases. Buying 100 shares at 500 and 100 at 400 puts your average at 450, not because of the number of trades but because each price counts in proportion to the quantity bought. Adding fees raises the average a little, since they are part of what you paid. Selling works differently under this method: shares leave at the running average, so the average cost per share stays put and the sale simply books a realised profit or loss against it. The remaining average is also your break-even price, which makes it the number to compare with the current price when deciding whether to add more.