About Stock Average Cost Calculator
When you buy the same stock at different prices, the average cost per share is the total amount paid divided by the total number of shares. It is the reference point for judging a position: a price above it means the holding is worth more than it cost, a price below it means the opposite. Long positions often accumulate across several purchases, so building the average from each lot is more accurate than averaging two prices by eye.
This calculator collects share counts, price per share and optional fees into a weighted average cost, then compares it with a current price you supply. It is not financial advice, it uses only the numbers you enter, and there are no live prices, dividends or exchange rates. Taxes and fees are excluded unless you enter a fee field, and the tool tracks an open position rather than realized sales.
What this tool does
Multiple purchase rows
Add one row per purchase with shares, price per share and an optional fee per lot, or paste the same data as CSV.
Fees in the cost basis
An optional fee on each row is added to that lot's cost, so the average cost per share reflects what you actually paid.
Weighted average cost
Total cost divided by total shares gives the average cost per share, weighted by the size of each purchase.
Market value and unrealized P/L
Enter a current price to see the position's market value, unrealized profit or loss and return percentage.
CSV paste
Paste rows as shares, price, fee — one purchase per line — to fill the table without retyping each field.
Input validation
Negative shares or prices, missing values and fees below zero are reported per row instead of producing a misleading average.
How to use Stock Average Cost Calculator
- 01
Add your purchases
Use the Add row button or paste CSV lines such as 100,10 and 50,12,1 into the import box.
- 02
Enter shares, price and fee
Fill in the number of shares, the price per share and an optional fee for each lot, in the same currency.
- 03
Add the current price
Enter a current price per share if you want market value, unrealized P/L and return percentage; leave it empty for the average cost only.
- 04
Read the results
Review total shares, total cost and average cost per share, then the market value, unrealized P/L and return percentage.
- 05
Copy or reset
Copy the saved values or reset the table to start a different position.
How this tool works
- Works with
- Stock cost basis
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- Not financial advice; it is an informational average cost and unrealized P/L tool using only the values you enter.
- No live prices, dividends or exchange rates, and no taxes or costs unless a fee field is filled in.
- Weighted average of entered lots only; sales, realized gains, FIFO/LIFO and corporate actions are not modelled.
- All rows must use one currency and price convention; the tool does not convert between currencies.
Privacy and file handling
Every calculation runs in your browser with plain JavaScript. The share counts, prices and fees you enter are never uploaded, stored or logged, and no request is made to a server while you use the calculator.
Read the full privacy policy
