Average Stock Price Calculator
Fast, accurate, and free online Average Stock Price Calculator tool that runs directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Average Stock Price Calculator
Calculate the weighted average purchase price of shares, including commissions, and analyze the potential profit.
Purchase Transactions
Profit/Loss Analysis (Optional)
Results will appear here
Enter your data and click "Calculate" to see the analysis.
Rate this tool:
Related tools
Other tools you may find usefulAverage Stock Price Calculator - Weighted Average Purchase with Fees
The tool calculates the real average price of one share based on several purchase transactions, including commissions and fees. In practice, each transaction may have a different unit price, different volume and additional costs, so the fairest picture of the situation is given by a weighted average, in which the weights are the number of pieces and all brokerage fees are added to the purchase cost. This gives you three key results at once: the total purchase cost, the total number of shares and the average price per share, which reflects the amount actually paid.
Run the calculator Tools home page
Formulas and logic of calculations
What do we calculate and why
The average share price is the sum of the full purchase costs divided by the total number of units purchased. The full cost includes the transaction price times the volume and all commissions and fees associated with the transaction. This model eliminates the illusions resulting from comparing prices without fees and allows for a sensible assessment of portfolio profitability, exit threshold and stop loss or take profit levels.
General formula
Weighted average price = (Σ (qtyi· pricei) + Σ feei) / Σ qtyi
- qtyi- number of shares in the i-th transaction,
- pricei- unit purchase price,
- feei- total commission and fees for the i-th transaction,
- Σ qty- the sum of all purchased items.
The result is three auxiliary values:total_cost- total purchase cost with fees,total_qty- total number of shares andavg_price- average price of one share after adding fees.
Rounding and good practices
In practice, it is worth adopting two decimal places for the result in currency and four places for partial prices if the instrument is valued with higher precision. In portfolios with frequent surcharges, control the stability of the commission currency and their type - minimum exchange fee, fixed platform fee, percentage commission on the order value.
Input fields in the tool
Transactions to average
- Transaction 1 - qty1pieces,price1unit price,fee1fees,
- Transaction 2 - qty2pieces,price2unit price,fee2fees,
- Transaction 3 - qty3pieces,price3unit price,fee3fees.
All fields have non-negative values. Enter volume in pieces, prices in account currency and fees as full amounts charged by the brokerage house.
Validation and Result
- Each number, price and fee field is validated as a numeric value greater than or equal to zero,
- The result includesaverage price, total cost i total volume,
- If the total of pieces is zero, the calculator does not calculate the average price - complete at least one transaction.
After clicking on the calculations, you receive ready-made values for use in a spreadsheet, in a brokerage system or in technical analysis.
Step-by-step examples
Example 1. Two transactions with different commissions
Data:Transaction 1 - 10 pieces of PLN 100, fees 0. Transaction 2 - 5 pieces of PLN 120, fees 5.
Calculations:Cost 1 = 10·100 + 0 = 1000. Cost 2 = 5·120 + 5 = 605. Total pieces = 15. Total costs = 1605.Average price = 1605 / 15 = 107.00.
Various commissions change the average price more when the second transaction has a small volume - the fixed fee is spread then for a smaller number of pieces.
Example 2. Three transactions and a high fee for a small order
Data:20 pieces at PLN 50, fee 0. 10 pieces at PLN 55, fee 0. 2 pieces at PLN 60, fee 10.
Calculations:Total cost = 20·50 + 10·55 + 2·60 + 10 = 1000 + 550 + 120 + 10 = 1680. Total pieces = 32.Average = 1680 / 32 = 52.50.
A high fixed fee for a small order can significantly increase the average price. It is worth combining orders if the minimum commissions are high.
Example 3. Checking the break-even point
Data:After calculating the average price, you got 73.20. The current market rate is 76.50. You want to know the profit cushion percentage.
Calculation:Margin to market = (76.50 - 73.20) / 73.20 · 100% = 4.51%.Conclusion:Only a drop of approximately 4.5% from the current price will bring the rate to your break even.
Example 4. Adjustment of the average after selling part of a block
Selling shares does not change the average price of historical purchases, but changes the total cost and the number of units held in the portfolio. If you want to calculate a new average after a sale, treat the sale as a negative volume with a price equal to your current average - then the average remains unchanged and only the stock and accounting cost decrease.
Auxiliary tables
| Parameter | Description | Unit | Notes |
|---|---|---|---|
| qty1, qty2, qty3 | Number of shares in the transaction | pcs. | Weights in the average weighted |
| price1, price2, price3 | Unit purchase price | by account currency | Precision in accordance with the instrument |
| fee1, fee2, fee3 | Commissions and transaction fees | by account currency | Fixed or percentage amounts converted to the amount |
| total_qty | Total number of shares acquired | pcs. | Σ qty |
| total_cost | Full purchase cost with fees | according to the account currency | Σ (qty·price) + Σ fee |
| avg_price | Average price of one share | by account currency | total_cost / total_qty |
How to use - quick instructions
- Enter the number of shares, price and fees for Transaction 1.
- Add data for Transaction 2 and possibly Transaction 3.
- ClickCount. You will get three values: average share price, total cost and total volume.
- Use the average price to determine your break-even point, set alerts, and evaluate sales orders.
Frequently asked questions - FAQ
Do commissions have to be added to the purchase cost?
Yes. This is the only way to ensure that the average price reflects the real unit cost. Fixed commissions especially distort the result for small orders.
What if I bought 0 pieces in one transaction or the price is 0?
A zero volume trade does not affect the average. A price of zero is not a valid market value - if this is a test, leave the price blank or enter a valid one.
Does the tool calculate the average also for short sales?
The presented model is intended for purchases. For short sellers, separate costs and settlement of positions are typically important, so treat this tool as a purchase averaging calculator.
How often should I update the average price in my portfolio?
After each purchase transaction and when additional fees arise. For part-bundle sales, the average remains the same, but the number of pieces and the accounting cost decrease.
Does the average price include dividends?
No. Dividends do not change the cost of purchase. However, you can calculate the rate of return separately, taking into account net dividends, and compare it with the break-even point.
Applications and tips
Planning to exit a position
Knowing the average price, you set price alerts, OCO order thresholds and take profit levels. Set a realistic profit target in relation to the risk and volatility of the instrument.
Controlling Transaction Costs
If high minimum commissions drive up the average price, consider making orders less frequent with higher volume or changing the fee schedule if your broker allows it.
Summary
The average share price calculator allows you, in a few seconds, to go from scattered transactions to one, reliable number that tells you how much you actually pay for one share after adding all fees. Enter the volumes, prices and commissions for your trades, clickCountand you will get the average price, total cost and total quantity. It is a simple procedure that organizes your portfolio and facilitates further investment decisions.