b2KIT

Stock Average Calculator

Calculate average cost basis from multiple stock purchases with total shares, weighted average price, and break-even analysis.

Tested tool guide Tested browser tools Checked August 16, 2026

What Stock Average Calculator does, with a checked example

Price averaging misleads because it ignores how many shares you bought at each price. This tool takes every purchase - quantity and price - sums the total invested, divides by total shares, and returns the weighted average cost per share, the position's total cost, and the break-even price at which selling recovers what you put in. The number most people get wrong: buy 100 shares at $40 and 200 at $50 and the average is $46.67, not $45, because the second lot carries twice the weight.

Worked example

A concrete input and expected output from the current implementation.

Input

100 shares at $40.00
200 shares at $50.00
50 shares at $60.00

Expected output

Total shares: 350
Total invested: $17,000.00
Average cost per share: $48.57
Break-even price: $48.57

Total cost is 100 x $40 + 200 x $50 + 50 x $60 = $17,000 across 350 shares, so the weighted average is 17,000 / 350 = $48.57 (unrounded 48.5714). Selling all 350 shares at that price returns exactly the amount invested, which is why break-even equals the average when no fees are entered.

How the result is produced

1

Weighted average, not price average

Each row's quantity is multiplied by its price, the products are summed, and the result is divided by total shares. A 200-share purchase therefore counts twice as heavily as a 100-share one. Total invested is the same sum of products, so adding any new lot at a different price always moves the average toward that lot's price.

2

Where break-even comes from

Break-even is total invested divided by total shares, which is the same number as the average cost when no fees are modeled. Selling the whole position at that price returns exactly the amount entered. Real-world costs such as commissions, slippage, and taxes sit outside these inputs unless the tool offers explicit fee fields, so the true recovery price is higher.

Good uses

  • You bought a stock in several lots at different prices and want the blended cost per share before deciding whether to add more or trim.
  • You are weighing an averaging-down purchase and want to see how far a lower-priced add actually moves the average.
  • You are reconciling your own purchase ledger against a broker statement or tax document and need the weighted average to spot discrepancies.

Limits and checks

  • Fees and slippage are typically not inputs. If the tool has no fee fields, break-even reflects only the prices you typed, and actual commissions raise the price you truly need to recover your cash.
  • The displayed average is rounded, so the arithmetic does not quite close: 350 shares x $48.57 = $16,999.50, not the $17,000.00 invested. That is rounding, not an error.
  • The figure is an accounting average, not a tax basis. For individual stocks the IRS generally assigns basis by specific identification or FIFO rather than an average, and wash-sale rules can adjust losses. Reconcile with your brokerage statement before relying on it for a filing.

Common questions

Does buying more at a lower price always pull my average down?

Yes, and the effect is largest early in a position's life. Adding 10 shares at $40 to 1,000 shares already bought at $60 moves the average from $60.00 to about $59.80, because the new shares are only about 1% of the position. Averaging down moves the needle most when the add is a large fraction of total shares.

Will this match my broker's cost basis?

In simple cases, yes: no sales, no splits, no fees, and the average-cost ledger will agree. After partial sales, or for individual stocks where tax rules generally allow specific identification or FIFO, brokers and the IRS can assign a different basis to the shares you sell. Treat the tool as a check, and use the broker's figure for reporting.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools