Stock Average Calculator
Calculate your average stock purchase price, total cost basis, and break-even price across multiple buy orders with commission support.
Purchase Details
Average Cost Per Share
—
your break-even price
Total Shares
—
Total Investment
—
Break-Even Price
—
Unrealized P&L
—
Current Position Value
—
Gain / Loss %
Calculation Details
Purchase Breakdown
| Row | Shares | Price | Cost | Commission | % of Total |
|---|
Purchase Price vs Average Cost
Embed This Calculator
Copy the code and paste it into any webpage to embed this calculator.
WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.
Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.
How to use this calculator
Enter each stock purchase as a row with shares, price per share, and an optional commission. Click Add Purchase to add up to 10 rows. Toggle Apply Stock Split if a split has occurred since your first buy. Enter the current market price at the bottom if you want unrealized profit and loss figures, then click Calculate.
Shares. The number of shares purchased in that specific order. Use the exact executed quantity, not a rounded number. Fractional shares are supported.
Price per Share. The price you paid per share in that order, before any fees. Use the execution price from your brokerage confirmation, not the bid or ask at the time.
Commission/Fee. Any flat brokerage fee, trading commission, or transaction cost for that specific purchase. Many modern brokers charge zero commission on US equities, but some still charge for options, foreign stocks, or managed accounts. Leave blank or enter 0 if no fee applied.
Split Ratio. If the stock has split since your earliest purchase, enter the cumulative split ratio (e.g. 2 for a 2-for-1 split, 3 for a 3-for-1, 0.5 for a 1-for-2 reverse split). The calculator adjusts all historical prices and share counts automatically.
Current Market Price (optional). If filled in, the results section shows your current position value, unrealized gain or loss in dollars, and gain percentage. Leave blank to calculate cost basis only.
Example: three purchases of the same stock
Purchase 1: 100 shares at $45.00, $5 commission Purchase 2: 150 shares at $38.00, $5 commission Purchase 3: 200 shares at $42.00, $0 commission
Total cost = (100 x $45 + $5) + (150 x $38 + $5) + (200 x $42 + $0) = $4,505 + $5,705 + $8,400 = $18,610
Total shares = 450
Average cost = $18,610 / 450 = $41.36 per share
If the stock is now trading at $50, unrealized gain = (450 x $50) - $18,610 = $3,890
What average cost per share actually tells you
Average cost per share is the single most important number for any position you hold in multiple tranches. It answers two questions simultaneously: what did this investment actually cost you, and how far does the stock need to move before you profit?
Many investors confuse the average price they paid with the average cost. They are the same only if you paid no commissions. In practice, every fee paid to enter a position raises your average cost and therefore raises your break-even point. A stock that appears profitable based on share price alone can still be at a loss when commissions are included, particularly for smaller position sizes bought through fee-charging brokers.
The average cost figure this calculator produces is a weighted average, not a simple average. A simple average treats each purchase equally regardless of how many shares were bought. A weighted average weights each price by the number of shares, which is the correct method because a larger purchase has more influence on your blended cost.
Your average cost is the price the stock must reach for your total investment to break even. It is not the average of the prices you paid. It is the total dollars out divided by total shares in.
Dollar cost averaging: the strategy behind multiple purchases
Dollar cost averaging (DCA) is the deliberate practice of investing a fixed dollar amount at regular intervals, regardless of the current share price. The result is that you automatically buy more shares when prices are low and fewer shares when prices are high.
Consider an investor who puts $1,000 into a stock every month for four months:
| Month | Price | Shares Bought | Cumulative Shares | Cumulative Cost | Avg Cost |
|---|---|---|---|---|---|
| 1 | $50.00 | 20.00 | 20.00 | $1,000 | $50.00 |
| 2 | $40.00 | 25.00 | 45.00 | $2,000 | $44.44 |
| 3 | $35.00 | 28.57 | 73.57 | $3,000 | $40.78 |
| 4 | $45.00 | 22.22 | 95.79 | $4,000 | $41.76 |
Notice that the average of the four prices paid is ($50 + $40 + $35 + $45) / 4 = $42.50. But the actual average cost is $41.76, which is lower, because more shares were accumulated during the cheaper months. This is the mathematical advantage of DCA: when prices fall, your fixed investment buys proportionally more shares, reducing your average cost below the simple price average.
DCA does not guarantee a profit, and it does not eliminate the risk of permanent loss if a company fails. But it removes the pressure of trying to time the market, reduces the regret of a single poorly timed lump-sum purchase, and produces a lower average cost than the average of prices paid in most declining or volatile markets.
Understanding cost basis for tax purposes
Cost basis is the value the IRS (and most tax authorities worldwide) uses to calculate your taxable gain or loss when you sell. For most stock purchases, cost basis equals the amount you paid for the shares including any commissions.
Getting your cost basis right matters because:
- Overstated basis reduces your taxable gain, saving you tax.
- Understated basis overstates your taxable gain, causing you to pay more tax than required.
- Accurate basis is legally required on Form 8949 in the US. Errors can trigger IRS notices.
Brokers are required to report cost basis to the IRS for most securities purchased after 2011 (equities) or 2012 (mutual funds). For shares held in accounts opened before those dates, you may need to reconstruct your own records.
Common situations that complicate cost basis include:
- Reinvested dividends: each reinvestment is a new purchase at the price on that date, adding to your basis.
- Stock splits: splits do not change your total cost basis but reduce the per-share basis proportionally.
- Spinoffs: the parent company’s basis must be allocated between the original stock and the new spinoff shares based on the relative fair market values on the spinoff date.
- Inherited shares: the basis is stepped up (or down) to the fair market value on the date of the decedent’s death, eliminating all appreciation in the decedent’s lifetime.
FIFO, LIFO, and average cost: which method to use
When you sell only some of your shares, you must specify which shares you are selling. Different methods produce different taxable gains.
FIFO (First In, First Out): sells the oldest shares first. If your earliest purchases had the lowest cost basis (common in a rising market), FIFO maximizes your taxable gain. However, FIFO can minimize gain if early purchases had high costs from a previous peak.
LIFO (Last In, First Out): sells the most recently purchased shares first. LIFO is not permitted for US tax purposes for individual investors, but it is sometimes used for inventory accounting.
Specific Identification: you tell your broker exactly which lot (purchase date and price) to sell. This is the most flexible method and lets you minimize taxes by choosing high-basis lots. Most modern brokers support this via online lot selection at time of sale.
Average Cost: computes a single blended cost for all shares and applies it to each share sold. This is the simplest method and what this calculator computes. It is the default method for mutual fund shares in the US. Once you elect average cost for a mutual fund, you generally cannot switch to specific identification for shares you previously sold using average cost.
For individual stocks, specific identification is almost always the most tax-efficient method when combined with tax-loss harvesting. For simplicity and consistency, many investors prefer average cost. The key is to choose a method and apply it consistently within each account.
How stock splits affect your cost basis
A stock split does not change your investment value or total cost basis. It changes only the number of shares you hold and the price per share proportionally.
For a 2-for-1 forward split:
- Your share count doubles.
- Each share’s cost basis is halved.
- Your total cost basis stays the same.
For a 1-for-10 reverse split:
- Your share count drops to one-tenth.
- Each share’s cost basis multiplies by ten.
- Your total cost basis stays the same.
The calculator’s Apply Stock Split feature adjusts all of your historical purchase prices and share quantities by the split ratio, then recomputes your average cost based on the post-split quantities. This gives you the correct average cost as it stands today after the split, which is the number that matters when comparing to today’s share price.
One common confusion: some brokers show your adjusted cost basis after splits automatically, while others show the original pre-split cost per share. If your broker’s reported average cost does not match what you expect, confirm whether the displayed figure has been adjusted for any splits. The toggle in this calculator lets you apply the adjustment manually when reconstructing your own records.
Averaging down: when it helps and when it hurts
Averaging down means buying more shares after the price has fallen, which lowers your average cost per share and reduces the percentage gain you need to break even.
The math is mechanical and always works: buying at a price below your current average will always lower the average. The question is whether it is a good investment decision, not a good arithmetic maneuver.
Averaging down makes sense when:
- You have thoroughly re-evaluated the investment thesis and it remains sound.
- The price drop was caused by a broad market decline or temporary sentiment, not a deterioration in the underlying business.
- You have the financial capacity to increase exposure to a single position.
- The valuation at the lower price is materially more attractive than at your original purchase.
Averaging down is dangerous when:
- The decline reflects real fundamental problems with the business.
- You are averaging down to psychologically avoid admitting a loss.
- The position already represents a large portion of your portfolio.
- You are throwing good money after bad in a business with structural problems.
Peter Lynch famously described averaging down into genuinely failing companies as “watering the weeds while pulling the flowers.” Always ask whether you would buy the stock fresh today at the current price, independent of what you already paid.
Tracking unrealized vs realized gains
This calculator reports your unrealized gain or loss, which is the difference between your current position value and total cost basis for shares you still hold. Unrealized gains are not taxable events. They become taxable only when you sell.
The distinction between unrealized and realized matters for several reasons:
Tax planning: You can choose when to realize gains by controlling when you sell. In a high-income year, you might defer taking gains until a lower-income year where a lower capital gains rate applies. Conversely, you can harvest unrealized losses at year-end to offset gains you have already realized.
Psychological pressure: Large unrealized gains can create pressure to sell prematurely to “lock in” the profit. Large unrealized losses create pressure to hold on hoping for a recovery. Separating the question “what is the best investment decision?” from “what is my current P&L?” leads to clearer thinking.
Wash sale consideration: If you sell shares at a loss to realize that loss for tax purposes, you must wait at least 31 days before buying the same or substantially identical security back. Buying within the 30-day window triggers the wash sale rule, disallowing the loss deduction and adding the disallowed amount to the basis of the replacement shares.
The current position value shown in the results is simply: Current Price × Total Shares (after any split adjustment). This is your mark-to-market value. Subtract your total investment to get the dollar unrealized gain or loss.
Reading the purchase breakdown table
The breakdown table lists each purchase row with six columns. Understanding each column helps you spot which purchases are driving your position’s performance.
Row: The sequential number of the purchase, in the order you entered them.
Shares: The number of shares in that purchase, adjusted for any stock split you applied. If you entered 100 shares and applied a 2-for-1 split, this column shows 200.
Price: The per-share price for that lot, adjusted for the split. A $100 purchase price before a 2-for-1 split appears as $50.
Cost: Shares multiplied by Price for that row only, not including commission. This is the raw equity cost of that lot.
Commission: The fee paid for that specific purchase. It is added to the cost column when computing the average.
% of Total: What fraction of your total investment (cost + all commissions) this specific lot represents. Lots with a high percentage have an outsized influence on your average cost. If one purchase accounts for 60% of your investment, that purchase’s price dominates your average.
The chart below the table colors each bar green if that purchase price is at or below your computed average cost, and red if it is above. A mostly green chart means you have built a position cost-efficiently relative to your average. A mostly red chart means your earlier purchases at higher prices are dragging your average up.
Frequently Asked Questions
What is average cost per share?
Average cost per share is the total amount you paid for all shares of a stock (including commissions) divided by the total number of shares you own. It is your effective purchase price and determines how much the stock must rise before you are profitable.
What is dollar cost averaging (DCA)?
Dollar cost averaging is the practice of investing a fixed dollar amount at regular intervals regardless of the share price. When prices are high you buy fewer shares; when prices fall you buy more. Over time this produces an average cost that is typically lower than the average price paid, because you automatically accumulate more shares at lower prices.
How does a stock split affect my cost basis?
A stock split increases your share count by the split ratio and reduces your cost per share by the same ratio. For a 2-for-1 split, you own twice as many shares at half the price each. Your total cost basis (total dollars invested) does not change. The calculator applies the split ratio to all historical purchases automatically.
What is cost basis and why does it matter for taxes?
Cost basis is the original value of an asset for tax purposes, usually the total amount paid including commissions. When you sell, your taxable gain or loss equals the proceeds minus the cost basis. Accurately tracking your cost basis prevents overpaying taxes and is required for correct tax reporting.
What is the wash sale rule?
The wash sale rule (IRS Rule 1091) disallows a tax loss if you buy a substantially identical security within 30 days before or after selling at a loss. If a wash sale occurs, the disallowed loss is added to the cost basis of the replacement shares, deferring the tax benefit rather than eliminating it permanently.
What is the difference between FIFO and average cost methods?
FIFO (First In, First Out) assigns the cost of the oldest shares to each sale, which can result in higher taxable gains when older shares have a lower cost basis. The average cost method uses a blended average price for all shares, simplifying record-keeping. Mutual fund investors commonly use average cost; individual stock investors often use FIFO or specific lot identification to minimize taxes.
Do brokerage commissions affect my cost basis?
Yes. Commissions paid to buy shares are added to your cost basis, and commissions paid to sell shares reduce your proceeds. This calculator adds purchase commissions to the total cost before computing your average price, giving you the true break-even price you need to reach before clearing a profit.
What is unrealized gain or loss?
An unrealized gain or loss is the difference between the current market value of your position and your total cost basis, for shares you still hold. It becomes a realized gain or loss (and taxable) only when you sell. Unrealized losses can be harvested for tax purposes by selling the shares, subject to the wash sale rule.
How do I lower my average cost per share?
You lower your average cost by buying additional shares at a price below your current average. This is called averaging down. While it can reduce your break-even price, it also increases your total exposure to a single stock. Never average down purely to lower the average without re-evaluating the investment thesis.
What is break-even price?
Break-even price is the price at which you recover exactly your total investment including all commissions. It equals your total cost (purchase price times shares plus commissions) divided by total shares. If the stock is trading above your break-even price, you are in profit. Below it, you are at a loss.
Related Calculators
Stock Profit Calculator
Calculate your net profit or loss from a stock trade — including brokerage fees, taxes, and dividends.
Annualized Return Calculator
Calculate annualized return (CAGR), total return %, and growth multiplier for any investment. Includes live growth chart comparing compound vs simple return.
ROI Calculator
Calculate Return on Investment (ROI), net profit, annualized ROI, and investment performance.
Maximum Drawdown Calculator
Calculate maximum drawdown, peak-to-trough loss, and recovery statistics from a portfolio value series. Interactive equity curve and shaded drawdown chart.
CAGR Calculator
Calculate Compound Annual Growth Rate from initial value, final value, and duration. Solve for any variable with multiple modes.
Rate of Return Calculator
Calculate rate of return, total profit/loss, and annualized return on any investment.