Stock Average Cost Basis CalculatorFree online financial calculator — instant results, no sign-up

Combine two stock purchases into a weighted average cost basis including fees.

Inputs

shares
$
shares
$
$
Total shares
150
Total basis$7,110.00
Average cost per share$47.40

Estimates only, based on the inputs and assumptions shown. This is not financial, investment, tax, or legal advice. Prices, rates and local rules may change; crypto scenarios do not predict returns. Confirm important decisions with a qualified professional.

Sign in to save results and favorites.

About the Stock Average Cost Basis Calculator

The Stock Average Cost Basis Calculator combines two purchases of the same stock into a weighted average cost per share, including combined purchase fees. It reports total shares, total cost basis, and average cost per share so you can see how the second purchase changes your overall purchase cost.

First shares (shares)
The number of shares acquired in the first purchase, entered in shares and defaulting to 100.
First price ($)
The price paid per share in the first purchase, entered in dollars per share and defaulting to $50.
Second shares (shares)
The number of shares acquired in the second purchase, entered in shares and defaulting to 50.
Second price ($)
The price paid per share in the second purchase, entered in dollars per share and defaulting to $42.
Combined purchase fees ($)
The total purchase fees for both transactions, entered in dollars and defaulting to $10.

Formula and method

S = q1 + q2; B = (q1 × p1) + (q2 × p2) + F; A = B / S. With the default inputs: S = 100 + 50 = 150 shares; B = (100 × $50) + (50 × $42) + $10 = $7,110.00; A = $7,110.00 / 150 = $47.40 per share.
  • q1Number of shares in the first purchase.
  • p1First purchase price in dollars per share.
  • q2Number of shares in the second purchase.
  • p2Second purchase price in dollars per share.
  • FCombined purchase fees in dollars.
  • STotal shares across both purchases.
  • BTotal purchase cost basis in dollars, including fees.
  • AWeighted average cost in dollars per share, including fees.

Multiply each purchase's share count by its per-share price to find its purchase cost. Add those costs and the combined purchase fees once to obtain total basis. Add both share counts, then divide total basis by total shares to obtain the weighted average cost per share. Keep full precision during calculation and round displayed dollar results to two decimal places.

Worked example

These are the calculator's starting values and the results it actually produces for them.

Inputs

  • First shares100 shares
  • First price50 $
  • Second shares50 shares
  • Second price42 $
  • Combined purchase fees10 $

Results

  • Total shares150
  • Total basis$7,110.00
  • Average cost per share$47.40

How to use the Stock Average Cost Basis Calculator

  1. 1Enter the first purchase's share count and price per share; the defaults are 100 shares at $50.
  2. 2Enter the second purchase's share count and price per share; the defaults are 50 shares at $42.
  3. 3Enter the fees for both purchases as one combined amount; the default is $10, and fees should not already be included in the entered prices.
  4. 4Review the calculated total shares and total basis: the default inputs produce 150 shares and $7,110.00.
  5. 5Read the average cost per share: the default inputs produce $47.40, including purchase fees.

Reading your result

Total shares is the sum of the two purchased quantities: 150 shares with the defaults. Total basis is the amount spent on both purchases plus combined purchase fees: $7,110.00. Average cost per share spreads that total basis across all 150 shares: $47.40 per share. This is a purchase-cost measure, not the stock's current market price or a calculation of investment return.

Limitations

The calculation assumes both purchases are for the same stock in the same currency, that all purchased shares remain held, and that entered fees are purchase costs included in basis. Share quantities, prices, and fees should be nonnegative, and total shares must be greater than zero. The tool does not adjust for sales, stock splits, reinvested dividends, return-of-capital distributions, wash sales, or other basis adjustments. It excludes future selling costs and taxes. A combined weighted average is useful for tracking purchase costs, but it does not establish the tax basis of shares sold; average-basis treatment generally is not permitted for ordinary individual stocks under U.S. tax rules, subject to limited exceptions.

Common questions

Why isn't the result a simple average of the two purchase prices?+

The first purchase contains 100 shares while the second contains 50, so the $50 price carries more weight than the $42 price. The calculator weights each price by its share count and includes the $10 combined fees, producing $47.40 per share.

Should I enter purchase fees separately for each transaction?+

Add the fees for both transactions together and enter the total in Combined purchase fees ($). The default $10 is added once to the combined purchase cost; do not also include it in the per-share prices.

Does buying the second batch at $42 reduce the combined average cost?+

Yes. With 100 shares at $50 and 50 shares at $42, plus $10 in combined purchase fees, the average becomes $47.40 per share, below the first purchase's $50 price.

Can I use $47.40 as the tax basis per share when selling this stock?+

Not automatically. This result is a blended purchase-cost measure. For ordinary individual stocks, U.S. tax reporting generally uses tax-lot rules such as specific identification or first-in, first-out rather than an average across purchases; applicable adjustments and exceptions also matter.

Does the calculator save my information?+

Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.

Further reading

You might also like

Results are estimates for informational purposes and are not financial, medical or legal advice.