Lelifi·tools

Stock Average Cost Calculator

Three lots of 50, 30 and 20 shares cost $10,450 in total, so the average cost is $104.50 a share. Buying 45 more shares at $90 moves the average to $100.00 across 145 shares. At a $90 price the position still shows a $1,450 unrealized loss, or 13.88% of cost.

Purchase lots (leave unused lots at zero)

Averaging down plan

Enter each purchase lot, commission and the current price to see your average cost per share, break-even, unrealized profit or loss, and the shares needed to reach a target average.

By the Lelifi editors ·

Key takeaways

Average cost after adding shares at $40 to 100 shares bought at $50$0$15$30$45$60$50.00start$46.67+50 sh$45.00+100 sh$44.00+150 sh$43.33+200 sh
Equal purchases at the same price buy smaller and smaller reductions in the average.
Cost contributed by each purchase lot$0$1750$3500$5250$7000$6,00050 sh at $120$2,85030 sh at $95$1,60020 sh at $80
Three lots, $10,450 of cost and one weighted average of $104.50.
On this page
  1. What average cost per share means
  2. A three lot example, step by step
  3. The share count that reaches a target average
  4. What each added lot does to the average
  5. Commissions, fees and small purchases
  6. Average cost is not the tax basis for stock
  7. Splits, dividends and reinvestment
  8. When averaging down stops making sense

What average cost per share means

Average cost per share is the total amount you paid for a position divided by the number of shares you own. It is a weighted average, so a large lot at one price pulls the result toward that price more than a small lot at another. The formula is short:

average cost = total cost / total shares

Total cost includes the price paid for every share plus any commission or fee charged on the buys. A $5 commission on a $1,000 order raises the effective cost by 0.5%; the same $5 on a $100 order raises it by 5%. That is why the calculator asks for a commission per order rather than a percentage.

Average cost answers three practical questions. It sets the break-even price for the position. It measures the unrealized gain or loss at today's quote. It gives a single number to compare against a plan to buy more. It does not tell you what the shares are worth, what they will be worth, or what the tax basis of a particular share is. Those are separate questions with separate rules.

One distinction worth keeping straight: average cost is an accounting view of your own purchases. Market price is what a buyer will pay right now. A position can have a $104.50 average cost and a $90 market price, and no amount of averaging down changes the market price. It only changes the average you will need to see before the position shows a profit.

A three lot example, step by step

Suppose you bought 50 shares at $120, then 30 shares at $95, then 20 shares at $80. The lots cost $6,000, $2,850 and $1,600. Add them and the position cost $10,450 for 100 shares, which gives an average cost of $104.50.

At a current price of $90, the position is worth $9,000. The unrealized loss is $1,450, or 13.88% of the $10,450 you paid. The break-even price is the average cost, $104.50, before any selling commission. A sale at $104.50 returns the cash you put in, ignoring taxes and fees.

Notice that $104.50 is not the average of $120, $95 and $80, which is $98.33. The share counts differ, so the simple price average gives each lot equal weight and the weighted average does not. The 50 share lot carries half of the position and most of the cost, which pulls the average up.

The same arithmetic works for any number of lots. Add the cost of each purchase, add the shares, divide. The calculator accepts four lots, which covers most brokerage statements; if you have more, combine the smallest ones into a single weighted lot first.

The share count that reaches a target average

A common question before adding to a losing position: how many shares do I need to buy to bring my average down to a specific number? Rearranging the weighted average formula gives a direct answer.

shares to buy = current shares x (current average - target average) / (target average - buy price)

The formula only works when the buy price is below the target average and the target is below the current average. If the buy price is above the target, no number of shares gets you there; each new share pushes the average up.

Example: 100 shares at a $50 average, a current price of $42, and a target average of $46. The share count is 100 x ($50 - $46) / ($46 - $42) = 100 x 4 / 4 = 100 shares. Buying 100 shares at $42 costs $4,200 and produces ($5,000 + $4,200) / 200 = $46.00.

Push the target closer to the market price and the required count rises fast. A target of $48 gives 100 x 2 / 6 = 33.33 shares, which costs $1,400 and produces $6,400 / 133.33 = $48.00. A target of $45 gives 100 x 5 / 3 = 166.67 shares, which costs $7,000. The last dollar of average reduction is always the most expensive.

What each added lot does to the average

The table starts from 100 shares bought at $50, a $5,000 position, and adds shares at $40 or $30. Every row keeps the original lot and adds one new purchase.

New purchaseTotal sharesTotal costNew averageAverage reduction
50 at $40150$7,000$46.676.67%
100 at $40200$9,000$45.0010.00%
150 at $40250$11,000$44.0012.00%
200 at $40300$13,000$43.3313.33%
100 at $30200$8,000$40.0020.00%

The first 50 shares at $40 cut the average by $3.33. The next 50 cut it by $1.67. The third 50 cut it by $1.00, and the fourth 50 cut it by $0.67. Each block costs the same $2,000, but it buys less and less average reduction. That diminishing return is the core math of averaging down, and it is why a plan that keeps doubling the position to chase a target average grows faster than most people expect.

Buying at $30 instead of $40 does more work per dollar, as the last row shows: 100 shares at $30 cut the average to $40.00, a 20% reduction. A lower buy price is the only lever that improves the ratio, and the market decides that price, not the plan.

Commissions, fees and small purchases

Commissions are part of what you paid, so they belong in the average. Three buys at $5 each add $15 to the $10,450 example, which lifts the average from $104.50 to $104.65. The position needs an extra $0.15 a share before it breaks even.

The effect is small on a large order and large on a small one. A $5 fee on a $10,000 buy adds 0.05% to the cost. The same fee on a $200 buy adds 2.5%, which can wipe out the benefit of buying a dip. If your broker charges a fixed fee, batch small purchases into fewer orders rather than buying every payday.

Order sizeShares at $100$5 fee per shareFee as % of order
$2002$2.502.50%
$1,00010$0.500.50%
$5,00050$0.100.10%
$10,000100$0.050.05%
$25,000250$0.020.02%

Fractional shares change the share count but not the formula. Buying 2.5 shares at $84 adds $210 of cost and 2.5 shares, and the weighted average handles the decimal without adjustment. Some brokers report the average to four decimals, which matters when the position is large; the calculator rounds the display to cents but keeps full precision in the arithmetic.

Regulatory fees on sales, such as the SEC Section 31 fee, are charged when you sell and reduce proceeds rather than raising cost. The SEC investor glossary treats cost basis as the amount paid for an asset, including commissions, which is the definition this page follows.

Average cost is not the tax basis for stock

The number this calculator produces is a useful portfolio measure, but for shares of stock it is not a tax method you can choose. The IRS allows average basis for shares in a mutual fund or a dividend reinvestment plan that meets the conditions in Publication 550. For ordinary stock, the choices are first in first out or specific share identification.

MethodStockMutual fund or DRIPWhat it does
First in, first outAllowed, and the default when shares cannot be identifiedAllowedSells the oldest shares first
Specific identificationAllowed with records at the time of saleAllowedYou choose which lots are sold
Average basisNot allowedAllowed when the Pub 550 conditions are metOne blended basis for every share

Why the distinction matters: a stock position with a $104.50 average can hold a first lot bought at $120 and a later lot bought at $80. Sell at $100 and the tax result depends on which lot the broker identifies. FIFO produces a $20 loss on the first lot; selling the $80 lot produces a $20 gain. Same average, opposite tax outcome.

The wash sale rule adds another constraint. If you sell shares at a loss and buy substantially identical shares within 30 days before or after the sale, the loss is disallowed and added to the basis of the replacement shares. Averaging down in a taxable account right after a loss sale can therefore postpone a deduction you were counting on. Publication 550 covers the rule and the exceptions.

Splits, dividends and reinvestment

A stock split changes the share count and the price per share, not the total cost. A 2 for 1 split turns 100 shares at a $104.50 average into 200 shares at $52.25. The position still cost $10,450, and the break-even price halves along with the quote. No tax is due at the split.

A cash dividend paid into your account does not change the average cost of the shares you already own. A dividend reinvested in new shares does, because the reinvestment buys additional shares with taxable cash. If a $95 dividend buys one share at $95, the position becomes 101 shares with $10,545 of cost, an average of $104.41. The change is small, but it compounds over years of reinvestment.

Return of capital distributions work in the opposite direction: they reduce the cost basis of the shares rather than adding to it, and a basis can be reduced to zero but not below. Spin-offs allocate part of the original basis to the new shares, usually in proportion to relative market values on the distribution date. Each of these events needs a basis adjustment that the simple average formula does not perform on its own.

For a quick portfolio check, the calculator handles splits by letting you edit the share count and price, and handles reinvestment by adding a lot. For tax reporting, use the basis your broker reports for covered shares and keep your own records for anything older or transferred in.

When averaging down stops making sense

A lower average feels like progress because the break-even line moves closer. The market price does not move because of your average, so the only thing that changed is the amount of money you have at risk. Three tests keep the decision honest.

The thesis test. Ask why the price fell. A broad market decline and a broken business look the same on a chart and are different investments. If the reason you bought no longer holds, a lower average is a larger bet on a thesis you no longer believe.

The position test. Set a maximum position size before you buy more. If a position is meant to be 5% of a $200,000 portfolio, the cap is $10,000, and a $10,450 position is already over it. Adding shares because the average looks high is not a reason to break the cap.

The drawdown test. A 50% fall from $50 to $25 needs a 100% gain to get back to $50. The deeper the fall, the more the required recovery outruns the arithmetic of averaging down. Run the break-even number before the trade, not after, and decide whether the position still earns its place in the portfolio at that size.

None of this says averaging down is wrong. It says the share count formula answers a math question, and the math question is the easy part. The hard part is deciding whether more exposure to the same stock is what the portfolio needs.

Frequently asked questions

How do I calculate my average stock cost?

Add the cost of every purchase, including commissions, then divide by the total number of shares. Three lots of 50, 30 and 20 shares cost $10,450, so 100 shares carry a $104.50 average.

Does buying more shares always lower my average cost?

No. A new purchase lowers the average only when its price is below the current average. Buying 20 shares at $110 against a $104.50 average raises the average to $105.42.

How many shares do I need to buy to reach a target average?

Use current shares x (current average - target) / (target - buy price). With 100 shares at $50, a $42 buy price and a $46 target, you need 100 shares, which costs $4,200.

Should commissions be included in the average cost?

Yes, because they are part of what you paid. Three $5 commissions add $15 to a $10,450 position and lift the average from $104.50 to $104.65, or $0.15 a share.

Is average cost the same as my tax basis?

For stock, no. The IRS allows average basis for mutual fund and DRIP shares that meet the Publication 550 conditions. Stock sales use FIFO or specific share identification instead.

What happens to my average cost after a 2 for 1 split?

The share count doubles and the average halves. 100 shares at $104.50 become 200 shares at $52.25, and the total cost stays at $10,450.

What is the wash sale rule?

A loss on a sale is disallowed if you buy substantially identical securities within 30 days before or after the sale. The disallowed loss is added to the basis of the replacement shares.

Can my average cost be lower than the lowest price I paid?

No. A weighted average of your purchase prices always sits between the lowest and highest price paid, before commissions. Commissions can only push it above the weighted price average.

What is the break-even price after averaging down?

The break-even price equals the new average cost, before selling fees and taxes. After buying 45 shares at $90 against 100 shares at $104.50, the average and the break-even both become $100.00.

Do reinvested dividends change my average cost?

Yes. Reinvested dividends buy additional shares, which adds both shares and cost. A $95 dividend buying one share at $95 moves a 100 share position from $104.50 to $104.41 across 101 shares.

Is averaging down a good idea?

It depends on why the price fell and how large the position already is. Averaging down increases exposure to the same stock, so set a position cap and recheck the thesis before adding shares.

How do I handle fractional shares?

Use the decimal share count in the same formula. Buying 2.5 shares at $84 adds $210 and 2.5 shares, and the weighted average handles the fraction without a special adjustment.

Why does my broker show a different average cost?

Brokers differ on commissions, on whether they include reinvested dividends, and on how they treat sales and transfers. Reconcile the lots yourself before relying on the displayed average for a tax decision.

What if I sold some shares and then bought more?

A sale reduces the share count and the total cost by the basis of the shares sold. If the broker uses FIFO, the oldest lots leave first and the remaining average can shift. Rebuild the position from the remaining lots to see the new average.

Spotted a wrong number or a broken result?

More Finance tools

See all Finance tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.