Skip to content
CalculatorBuddy

Stock Average Calculator

Find your weighted average share price across multiple purchases, including fees, and estimate profit or loss at a chosen sell price.

Maintained by Pruthvirajsinh ZalaEditorial methodology

Changes money labels only. Amounts are not converted and local tax or lending rules are not applied. Article examples keep their stated currency.

ExampleSample values — edit any field to see your result.

One purchase per line, up to 200. Example: 10, 20, 2 means 10 shares at 20 each plus a 2 purchase fee. No thousands separators.

$

Optional; enter zero to model a total loss.

Results update as you type.

Average cost per share

$16.8000

Total purchase cost, including entered fees, divided by shares purchased.

Estimated result

Total shares
15.000000
Total invested
$252.00
Purchase fees
$2.00

Saved calculations stay only in this browser. Share copies a link containing your entered values.

Compare scenarios

Keep a baseline, then change an assumption to see its effect side by side.

Purchase breakdown

PurchaseSharesUnit priceFeeTotal cost
110.00$20.00$2.00$202.00
25.00$10.00$0.00$50.00

Combine multiple purchases of the same security into a weighted average cost per share. Include purchase fees and optionally enter a market or target sell price to estimate the value and potential gain of the entire holding.

Entering your purchases

Add one purchase per line in the form shares, price, optional fee. For example, 10, 20, 2 means ten shares bought at 20 each plus a fee of 2 for that purchase. Paste up to 200 lines. Do not use thousands separators, currency symbols, or column headings. A fee belongs to the entire row, not each share.

Use only purchases belonging to the position you are evaluating, in the same currency and adjusted to a consistent share basis. Enter the optional sell price per share if you want a valuation. The currency selector changes labels and does not convert currencies.

Reading the results

Total invested includes all entered purchase fees. Average cost is total invested divided by total shares. Potential gain or loss compares the value at the sell price with that cost. It excludes sale fees, taxes, dividends, and previously realized gains. The purchase table lets you check each row before relying on the total.

Examples

Unequal purchases with a fee

Buy 10 shares at 20 with a 2 fee, then 5 shares at 10 with no fee. You hold 15 shares with 252 invested, so average cost is 16.80 per share. An unweighted average of 20 and 10 would incorrectly give 15.

Value the position at 18 per share

Those 15 shares would be worth 270 at 18 each. Compared with the 252 purchase cost, potential gain is 18, or approximately 7.1429%, before any selling costs or taxes.

Formula

Total shares = sum of shares in each purchase
Total cost = sum of (shares × price + purchase fee)
Average cost = total cost / total shares
Potential gain = total shares × sell price − total cost

If all purchase costs are zero, the average is zero and percentage return is omitted because its denominator would be zero.

Purchase average versus tax basis

This calculator does not track disposals or choose which tax lots were sold. Stock splits, transferred holdings, reinvested distributions, and tax adjustments need careful records. For US tax context, the IRS overview of asset basis explains why basis may require adjustments beyond an initial purchase price.

A lower average cost after another purchase does not mean lower total risk: your total amount invested and exposure also increase.

Frequently asked questions

Why is the average weighted by shares?
A larger purchase contributes more shares and cost, so it has more influence on your average. Averaging the listed prices alone is only correct when the quantities are equal and no fees are included.
Can I enter fractional shares and fees?
Yes. Each row accepts a positive share quantity, a non-negative price, and an optional non-negative purchase fee. Fractional share quantities are supported.
Is this my taxable cost basis?
Not necessarily. It is a purchase-cost average. Sales, tax-lot elections, splits, reinvestments, wash-sale adjustments, and local tax rules can require a different basis calculation.
What happens if I leave sell price blank?
You get the purchase average and totals without a valuation or gain estimate. Entering zero explicitly models the shares having no sale value.

Related calculators