Average Price Calculator
Average Price Calculator
Enter the current price to see unrealized P/L and break-even analysis.
Simulate the impact of an additional purchase on your average cost.
Enter Your Transactions
Add at least one transaction with shares (or dollar amount) and price per share to calculate your weighted average cost basis.
Important
This calculator is provided for general information only and is not financial, tax, or legal advice. Results are estimates and do not reflect your full circumstances, current rates, fees, or eligibility rules. Speak to a qualified professional before making a financial decision.
Weighted average cost basis across all your buy transactions — with P/L, break-even, and what-if analysis
Every investor who has bought shares more than once faces the same question: what is my actual average cost per share? Whether you bought Amazon stock in three different months, added to your Bitcoin position during a dip, or systematically invested in an S&P 500 ETF through dollar-cost averaging, your effective cost basis is the weighted average of all those purchases — not a simple arithmetic mean. Our Average Price Calculator does exactly that. You enter each transaction — the number of shares and the price you paid — and the tool instantly computes your weighted average cost per share, total shares held, total capital deployed, and the number of transactions recorded. The calculation updates in real time as you type, so you can iterate through scenarios without ever clicking a button. Beyond the core weighted average, the calculator unlocks a full set of portfolio analytics when you enter the current market price. It shows your unrealized profit or loss in both dollar terms and percentage terms, and — if your position is underwater — it tells you exactly how far the stock needs to rally to get you back to break even. These figures are displayed with comparative bar charts so you can see at a glance how far apart your average cost and the current market price are. For investors thinking about adding to their position, the What-If New Buy panel lets you simulate the effect of a hypothetical purchase. Enter the additional shares and the price you would pay, and the calculator instantly shows your new average cost, new total shares, and new total invested capital. This is invaluable when deciding whether averaging down or averaging up makes sense for your strategy. The tool supports two entry modes for each transaction. In standard mode you enter shares and price per share — for example, 50 shares at $42.00. In dollar-amount mode you enter the total dollars invested and the price — for example, $2,100 invested at $42.00 — and the calculator derives the share count automatically. This mirrors how many brokerage confirmations actually report trades and makes it easy to work from statements rather than doing mental arithmetic. All calculations happen instantly in your browser. No data is ever sent to a server. You can add as many transaction rows as you need — there is no cap — and remove any row with a single click. A CSV export button lets you download the full transaction breakdown plus summary results for your own records or tax preparation. Visual output includes a donut chart that shows each purchase lot's proportional share of your total investment, a per-transaction breakdown table with subtotals and percentages, and horizontal bar charts comparing your average cost to the current market price. These visuals make it easy to see which purchase lots dominate your cost basis and how your blended average relates to where the asset trades today. The calculator works for any asset class: common stocks, preferred shares, ETFs, mutual funds, REITs, bonds (using price-per-unit), and cryptocurrencies including fractional positions. Prices as small as $0.0001 and share quantities as small as 0.0001 are accepted, making it equally useful for micro-cap stocks and crypto coins.
Understanding Average Price Calculation
What Is a Weighted Average Purchase Price?
A weighted average purchase price — often called cost basis per share — is the dollar amount you effectively paid per share when you account for differing quantities across multiple buy orders. It is not the simple average of the prices you paid; it weights each price by how many shares you bought at that price. If you bought 100 shares at $10 and 100 shares at $20, your simple average is $15 — and in this case that equals the weighted average because the quantities are equal. But if you bought 200 shares at $10 and 50 shares at $20, your weighted average is (200×$10 + 50×$20) / (200+50) = $12.00, not $15. The weighted average is the only figure that tells you your true breakeven price and the true profit or loss of the entire position.
How Is Average Price Calculated?
The formula is straightforward: multiply each transaction's share count by its price, sum all those products, then divide by the total share count. Formally: Average Price = (Q1×P1 + Q2×P2 + ... + Qn×Pn) / (Q1 + Q2 + ... + Qn). From this base the calculator derives Total Cost (the numerator alone), Total Shares (the denominator), and — when you supply the current market price — Unrealized P/L in dollars ((Current Price − Average Price) × Total Shares) and in percent (((Current Price − Average Price) / Average Price) × 100). The break-even distance is calculated as ((Average Price − Current Price) / Current Price) × 100 and is only shown when the current price is below your average cost, meaning additional upside is required to recover.
Why Does Your Cost Basis Matter?
Your average cost basis matters for several reasons. First, it determines whether your position is profitable: if the current price exceeds your average cost you are in profit; if it is below you are at a loss. Second, cost basis is the foundation of capital gains tax calculations. In the US, the IRS requires you to report your gain or loss as the difference between sale proceeds and your cost basis; using the wrong figure can mean under- or over-paying taxes. Third, understanding your average cost helps you make rational add-to-position decisions. Many investors use averaging down — buying more shares when a stock falls — to reduce their break-even price, but only knowing the actual new average helps you assess whether that strategy is working or concentrating risk. Fourth, institutions and fund managers track cost basis as a key portfolio metric alongside market value and unrealized gains.
Limitations and Things to Keep in Mind
This calculator computes a simple weighted average cost basis and does not account for brokerage commissions, currency conversion costs, stock splits, reverse splits, dividends reinvested, or return-of-capital distributions. In practice all of these events adjust your effective cost basis. For example, after a 2-for-1 stock split your cost basis per share is halved but your total cost remains the same. Reinvested dividends create additional purchase lots that should be entered as separate transaction rows. The unrealized P/L shown is theoretical — it represents the gain or loss if you sold all shares at exactly the current market price, which ignores bid/ask spread, market impact, and taxes. For official tax filing always reconcile figures with your brokerage cost-basis reports, particularly if you hold shares across multiple tax lots or have transferred shares between accounts.
How to Use the Average Price Calculator
Enter Your Purchase Transactions
Each row represents one buy order. Enter the number of shares you bought and the price you paid per share. For fractional shares or crypto, decimals are fully supported. If you prefer to enter the total dollar amount you invested rather than share count, click 'Switch to $ Amount' on that row and enter the invested dollars instead — the calculator will derive the share count automatically.
Add More Rows as Needed
Click 'Add Transaction' to add another purchase row. There is no limit on the number of transactions you can enter. Add rows for every separate buy order — different dates, different prices. Use the X icon on any row to remove it. The calculation updates live with every keystroke so you always see your current weighted average without clicking anything.
Optionally Enter the Current Market Price
Scroll down in the input panel to the 'Current Market Price' field. Entering the live share price unlocks the Unrealized P/L section, showing your gain or loss in both dollar terms and percentage terms. If you are at a loss, the calculator also shows the percentage gain required for the position to break even.
Model a What-If Scenario and Export Results
Use the 'What-If New Buy' section to simulate adding to your position. Enter additional shares and the hypothetical purchase price to instantly see the new blended average, new total shares, and new total invested capital. When you are satisfied with your analysis, click 'Export CSV' in the Transaction Breakdown card to download all data for your records or tax preparation.
Frequently Asked Questions
What is the formula for calculating average stock price?
The formula is a weighted average: multiply each transaction's share quantity by its price per share, sum all those products, then divide by the total number of shares across all transactions. Written out: Average Price = (Q1×P1 + Q2×P2 + ... + Qn×Pn) / (Q1 + Q2 + ... + Qn). This gives you the true cost basis per share — the price at which your total investment is exactly recovered if you sell. A simple arithmetic average of prices is incorrect because it treats a 10-share purchase the same as a 1,000-share purchase, which distorts the true cost basis. Always use the weighted formula for cost basis calculations.
What is the difference between averaging down and dollar-cost averaging?
Averaging down is a deliberate, reactive strategy: you buy more shares specifically because the price has fallen below your current average cost, with the goal of reducing your break-even price. It is a concentrated bet that the asset will recover. Dollar-cost averaging (DCA) is a systematic, time-based strategy: you invest a fixed dollar amount at regular intervals regardless of price. DCA does not require prices to fall — you buy at whatever the market price is on schedule. Both strategies result in a blended average cost, and this calculator handles both equally well by letting you enter as many transactions as needed at any prices and quantities.
Does this calculator account for stock splits?
No — stock splits, reverse splits, and other corporate actions are not handled automatically. After a forward stock split (e.g., 2-for-1), you should adjust your historical transaction rows: double the share quantities and halve the prices. For example, 100 shares at $200 becomes 200 shares at $100 after a 2-for-1 split. Your total investment stays the same but the per-share figures change. Always check your brokerage account for split-adjusted cost basis figures, as brokers typically maintain accurate records of adjusted cost basis following corporate actions.
How do I calculate my average cost for fractional shares or cryptocurrency?
This calculator fully supports fractional quantities and very small prices. For crypto or fractional shares, simply enter the decimal quantity in the Shares field — for example, 0.5 BTC or 12.375 shares. For low-priced assets like penny stocks or small-cap crypto, enter the full decimal price including many decimal places — the calculator handles values as small as $0.0001. The weighted average formula works identically regardless of whether quantities are whole numbers or fractions, so the same tool works seamlessly for stocks, ETFs, bonds, and all cryptocurrency assets.
What does 'break-even percentage' mean in this calculator?
The break-even percentage tells you how much the current market price needs to rise, expressed as a percentage, to equal your average cost basis. It is only shown when the current market price is below your average cost — meaning your position is at an unrealized loss. The formula is: ((Average Cost − Current Price) / Current Price) × 100. For example, if your average cost is $50 and the stock trades at $40, you need a 25% gain from $40 to reach $50. This metric helps you assess the recovery required before a trade becomes profitable and can inform decisions about whether to hold, add to, or exit the position.
Can I use this calculator for mutual funds, ETFs, bonds, or crypto?
Yes. The weighted average formula is asset-class agnostic. You can use it for common stocks, preferred stocks, ADRs, ETFs, index funds, mutual funds (using NAV as price), bonds (using clean price or dirty price per unit), REITs, and any cryptocurrency. The key requirement is consistent units: all share/unit quantities and prices within a session must refer to the same asset. For a portfolio with multiple different assets, run a separate calculation for each asset. Each instrument's average cost is calculated independently since mixing quantities from different assets would produce a meaningless blended number.