Stock Average Calculator - Cost Basis and Profit
Use this stock average calculator for up to four stock buys and get the weighted-average cost basis, total shares, and current value with profit or loss.
Stock Average Calculator
Results
What Is Stock Average Calculator?
A stock average calculator is a personal-finance tool that turns several share purchases of the same stock into one weighted-average cost per share, also called the cost basis. It then compares that cost basis to the current market price so you can see the size of the unrealized gain or loss on the position.
- • Average down a losing position: Add up the dollars and shares from each buy so you can see what a single new lower-priced purchase really does to your break-even price.
- • Track cost basis for tax planning: Get the per-share basis the IRS uses when you later sell part or all of the position.
- • Compare your entry to today's price: Enter a current price to see dollar and percent gain or loss without rebuilding the math in a spreadsheet.
- • Document a starter position: Capture the first few share lots so the original buy plan is visible in one place.
The result is a single number that represents what you actually paid per share on average. That same number is what the IRS calls your cost basis, and it is the starting point for any capital-gain math when you sell.
Use a stock average calculator for educational and planning reasons, not as investment advice. The output is purely arithmetic, so it does not capture dividends, stock splits, brokerage commissions, or tax treatment.
When the position is held for tax planning or a planned sale, the stock calculator adds a current price and a buy-and-sell view on top of the same numbers.
How Stock Average Calculator Works
The calculator adds up each purchase and divides by the total number of shares bought, which is the same operation the IRS uses to define a stock's cost basis.
- Share counts (q1 to q4): Number of shares bought in each of up to four purchases.
- Share prices (p1 to p4): Price per share paid in each of those purchases, in dollars.
- Current price: Latest market price per share. Leave at 0 to skip the current value and gain or loss row.
The order of operations is straightforward: the calculator multiplies each share count by its price to get a per-purchase dollar total, sums those products for the total cost, sums the share counts for the total shares, and then divides total cost by total shares.
When a current price is entered, the calculator multiplies it by total shares to get the current value, subtracts total cost to get the profit or loss, and divides by total cost to get the percent. With no current price, those three values stay at zero so the cost basis output still works.
Four small buys at falling prices
Inputs: buy 1 = 1 share at $85, buy 2 = 1 share at $84, buy 3 = 1 share at $83, buy 4 = 1 share at $75, current price = $100.
Total cost is $85 + $84 + $83 + $75 = $327, total shares is 4, so the average price is $327 / 4 = $81.75. Current value is $100 x 4 = $400, profit is $400 - $327 = $73.
Result: average price is $81.75, total cost is $327, current value is $400, and the position is up about 22.32% on cost.
Averaging down from $85 to $75 lowered the break-even from the highest buy to $81.75, which is the number to remember when sizing a future sell.
According to Internal Revenue Service, Topic No. 703, your basis in stocks is the purchase price plus any additional costs such as commissions and recording or transfer fees.
For a single share lot, the price per share calculator shows the simpler price-per-share math without the weighted average across multiple buys.
Key Concepts Explained
Four short ideas keep the output in the right frame before you act on it.
Cost basis
Cost basis is what the IRS calls your average buy price. It is the number used to figure gain or loss when shares are sold.
Weighted average
The average is weighted by share count. A 100-share buy moves the average much more than a 1-share buy at the same price.
Averaging down
Adding more shares at a lower price pulls the average down. It lowers break-even but adds dollars at risk to the position.
Unrealized gain or loss
The profit shown is unrealized because the shares have not been sold. The gain or loss becomes realized when shares are actually sold.
The output is a snapshot, not a forecast. A lower average is not the same as a better investment, and a higher average is not the same as a bad one. The number is only useful when paired with the company's story and your plan.
Watch the difference between simple and weighted average. A simple average of $85 and $75 would be $80, but a 1-share-at-$85 and 100-share-at-$75 position has a $75.25 average because the bigger buy dominates the math.
When the cost basis is set and the question becomes how the position has actually performed, the average return calculator returns the realized return over a period.
How to Use This Calculator
Enter each purchase on its own row, then add the current market price to see the gain or loss side of the table.
- 1 List every buy in order: Write down each purchase date, the number of shares, and the price per share you paid so the rows match real trades.
- 2 Enter the first two purchases: Fill the share count and price for the first two buys. These are enough to get a meaningful weighted average.
- 3 Add the third and fourth buys if you have them: Use the extra rows for later trades. Leave both share count and price at 0 to skip a row.
- 4 Enter the current market price: Type the latest share price to show the current value, profit, and percent rows. Leave it at 0 to only see cost basis.
- 5 Read the average price row first: Confirm the weighted average matches your own notes before you trust the gain or loss number.
- 6 Save the inputs for later: Keep the form open or screenshot the inputs so you can refresh the calculation after the next buy or the next market move.
For example, buying 10 shares at $100 and then 5 shares at $50 gives a total cost of $1,250 across 15 shares, an average price of $83.33, and at a $120 current price the position shows a $550 gain or about 44% on cost.
If each buy is from a different date and you also want the percent return per lot, the holding period return calculator covers a single buy-and-sell pair cleanly.
Benefits of Using This Calculator
The stock average calculator is most useful when you want a quick, traceable number before you keep, add to, or trim a position.
- • One number for many trades: Turns four or more share lots into a single weighted-average price without rebuilding the math in a spreadsheet.
- • Tax-ready basis: Produces the per-share basis you will need to figure capital gain or loss when shares are eventually sold.
- • See the break-even quickly: Shows the share price the position needs to reach to cover the dollars invested, no matter how many buys made it up.
- • Compare two plans: Change one input to see how a new buy at a different price would shift the average, total cost, and percent return.
- • Keep assumptions visible: Every share count, price, and current price stays on the form, so the result is easy to defend in a journal or tax note.
Use the output alongside other planning tools. The average price by itself does not measure risk, valuation, or the chance that a stock recovers from a low. Pair it with a return calculator or a beta calculator when you want a fuller picture.
The result is most useful when the inputs are honest. Include every buy, even small reinvested dividends if you treat them as a purchase, so the basis number is the one you would defend on a tax form later.
After the average price is in hand, the return on investment calculator takes the same total cost and exit value to show the realized return on the position.
Factors That Affect Your Results
Several choices can change the average even when the position itself has not changed, and the calculator makes a few deliberate simplifications.
Share-count weighting
Large buys dominate the average. A 100-share buy at $50 moves the average much more than a 1-share buy at $30, even though the prices look similar.
Skipped buy rows
Leaving share count or price at 0 excludes that row. Use the zeros deliberately when a position only has two or three trades so the math stays clean.
Current price timing
The current price is a snapshot. Refresh it after market hours or use the day's close to avoid mixing intraday and end-of-day numbers.
Fees and commissions
Brokerage commissions, exchange fees, and SEC fees are not entered. Add them to the price per share or to the total cost if you need an after-fee basis.
Dividends and splits
Reinvested dividends add tiny lots, and stock splits change the share count. Both are outside this simple four-row model and need their own adjustments.
- • The model uses up to four purchases. Positions built across many small dividend reinvestments need to be summed first and entered as one row.
- • The output is purely arithmetic. It does not include capital-gains tax, which can change the real return once shares are sold.
- • Leaving the current price at 0 is treated as no comparison, not as a price of zero. The current value, profit, and percent rows will read 0 in that case.
If the average and your brokerage statement disagree, slow down. The most common causes are missed reinvested dividends, a forgotten buy, or a stock split that the simple form does not handle.
Refresh the calculation after every new buy. A position that started as one trade can become a much larger weighted average, and the cost-basis number that matters for tax time is the one closest to the sale date.
According to FINRA, capital gains are profits left over after you sell shares for more than you paid.
According to U.S. Securities and Exchange Commission, Investor.gov, short-term stock sales are taxed at the regular income rate rather than the lower long-term capital-gains rate.
Once the gain is known, the capital gains tax calculator applies the holding-period tax rate so the net-of-tax return can be compared with the percent shown here.
Frequently Asked Questions
Q: What does a stock average calculator do?
A: A stock average calculator takes several purchases of the same stock and turns them into one weighted-average cost per share. That single number is your cost basis and the starting point for any gain or loss math when shares are sold.
Q: How do I calculate the average price of a stock I bought at different prices?
A: Multiply each purchase price by the number of shares bought at that price, add those products together to get the total dollars invested, and divide by the total number of shares. The result is the weighted-average price per share for the position.
Q: What is the cost basis of a stock?
A: Cost basis is the average price you paid for the shares you still own. The IRS uses cost basis to figure the gain or loss reported on a sale, and brokers usually keep a per-lot basis for each buy.
Q: How do I calculate profit or loss on multiple stock purchases?
A: Find the total dollars invested and the total number of shares, then divide to get the average price. Multiply the current share price by total shares to get the current value, and subtract total cost to get the profit or loss in dollars.
Q: What is dollar-cost averaging in stocks?
A: Dollar-cost averaging means putting a set dollar amount into the same stock on a schedule regardless of price. The result is a weighted average that smooths out the effect of any single buy, which is exactly what the stock average calculator measures.
Q: Does stock average include dividends or fees?
A: No. This calculator uses only the share count and price per share. Reinvested dividends, brokerage commissions, and exchange or SEC fees are not included, so add them to the price or to the total cost when an after-fee basis is needed.