Stock Average Cost Calculator

Calculate weighted average purchase cost, total shares, total invested amount, and optional transaction fees across multiple stock purchases.

Start here

Enter the shares and price for each purchase.

Browser-first

Your purchase entries are calculated locally in your browser and are not uploaded to a server.

Useful for

Combine several purchases into a weighted average

Purchases

Use the same currency for every price. Fractional shares are allowed.

PurchaseSharesPrice per shareCost with feeRemove
1$400.00
2$1,500.00
Weighted average cost$47.50 / shareTotal cost ÷ total shares
Total shares40
Total invested$1,900.00Gross purchases: $1,900.00
Modeled fees$0.00

Purchase arithmetic only. Broker and tax cost basis may include lot elections, wash-sale adjustments, corporate actions, distributions, taxes, and other account-specific rules.

Back to tool
Quick answer

Calculate weighted average cost across stock purchases

Add each purchase's share count, price, and optional fee to calculate total shares, total invested amount, and weighted average cost per share.

Use this when

You bought the same security at different prices and need a consistent scenario estimate before comparing a sale price.

Know the boundary

The arithmetic average may not equal the tax cost basis shown by a broker because tax lots, corporate actions, wash sales, and local rules can differ.

Useful next step

Position Size Calculator: Estimate shares from account risk, entry price, stop price, available capital, and optional transaction fees.

About this tool

Calculate weighted average purchase cost, total shares, total invested amount, and optional transaction fees across multiple stock purchases.

Your purchase entries are calculated locally in your browser and are not uploaded to a server.

Reminder

This is purchase arithmetic, not a broker-confirmed or tax cost basis. Corporate actions, reinvested distributions, wash-sale or equivalent rules, foreign exchange, taxes, and account-specific adjustments may change official records.

How to use it

  1. Enter the shares and price for each purchase.
  2. Choose an optional fixed or percentage fee method and use one currency consistently.
  3. Calculate total shares, total cost, and weighted average cost per share.

Common use cases

  • Combine several purchases into a weighted average
  • Estimate a new average before adding shares
  • Include simple transaction-fee assumptions
  • Separate purchase arithmetic from current market performance

Weighted Average Purchase Cost

Multiply the shares in each purchase by its price, add any transaction costs you choose to include, total all purchases, and divide by total shares. Do not average the price rows without weighting them by quantity.

PurchaseCost before feesWeighted contribution
10 shares at $40$40010 shares
30 shares at $50$1,50030 shares
Combined$1,900$47.50 per share before fees

Calculator Average Versus Tax Cost Basis

The arithmetic result can help with scenario planning, but a tax cost basis may depend on the security type, jurisdiction, account election, lots sold, reinvested distributions, wash-sale adjustments, and corporate actions.

  • Reconcile the calculator with broker confirmations rather than replacing official records.
  • Keep fees either included for every row or excluded for every row when comparing scenarios.
  • Ask a qualified tax professional which lot-identification or average-basis rules apply to the account.

FAQ

How is average stock cost calculated?

Add the cost of every purchase, including any fees you choose to include, then divide by the total number of shares.

Is this a simple average of the prices?

No. It is weighted by share count, so a larger purchase has more effect on the average than a smaller purchase.

Can I enter fractional shares?

Yes. The calculator accepts fractional shares as long as the value is positive.

Does this calculate my tax basis?

No. Tax basis can depend on jurisdiction, account elections, wash sales, corporate actions, and broker adjustments. Use official records or a qualified tax professional.