Free calculator

Stock average cost calculator

Combine purchases into one share-weighted average. Enter the shares and price for each lot to see total shares, total purchase cost and average cost per share.

See the method and worked examples ↓

Lots

Results

Average cost / share
$50.00
Total shares
100.0000
Total cost
$5,000.00
Market value
$5,500.00
Unrealized gain / loss
$500.00
Unrealized %
10.00%

Estimates only — not financial advice.

Assumptions

  • Average cost only, not FIFO or specific ID
  • No dividend reinvestment, no fees
  • Pre-tax, nominal, no inflation adjustment

Not for tax filing — use your broker’s official reports and a tax professional.

The calculation

For each lot, multiply shares by purchase price. Add those purchase amounts, then divide by the total number of shares:

Average cost per share = sum of lot purchase amounts ÷ total shares

A simple average gives small and large purchases the same weight. When lots contain different numbers of shares, that can give the wrong result.

Purchase prices are rounded to cents first. Each lot's purchase amount and the displayed average are then rounded to cents. Extra decimal places in a broker's execution price are not preserved in this calculation.

Two purchases, one average

Suppose you bought 10 shares at $40 and later bought 30 shares at $60.

PurchaseSharesPrice per sharePurchase amount
First lot10$40.00$400.00
Second lot30$60.00$1,800.00
Total40$2,200.00

The average is $2,200 ÷ 40 = $55 per share.

Averaging $40 and $60 would produce $50, but three quarters of the shares were bought at $60. The larger purchase has to carry more weight.

If the current price you enter is $55, the 40 shares have a modeled market value of $2,200. The unrealized difference is $0 before fees and other adjustments.

What the optional current price adds

To estimate a current holding, enter the shares still held in each purchase lot, using your broker's remaining-lot records. If you enter a complete purchase history that includes shares already sold, the result represents that entered history; it is not your current holding's value.

Current price is used to calculate market value:

Market value = total shares × current price

The calculator subtracts total entered purchase cost from that value to show an unrealized gain or loss. The percentage uses total purchase cost as the denominator.

Leaving current price blank leaves these results blank. No live quote is fetched. A result based on an old or hypothetical price is not a current account valuation.

Unrealized means the difference has not been calculated from an actual sale here. The tool does not decide which shares were sold, account for sale proceeds or calculate a taxable gain.

Average purchase cost and tax basis are different tasks

This tool combines the purchase lots you enter. It has no fields for commissions, return of capital, wash-sale adjustments, gifts, inherited shares, transfers or tax-lot selection.

The IRS explains that the basis of purchased stocks can include purchase-related costs and may require adjustments. Those rules go beyond the arithmetic on this page. See IRS Topic 703: Basis of assets.

Do not treat the displayed average as the basis of a specific sale. FIFO, specific identification and any permitted average-basis method are not selected or applied by this calculator.

If dividends bought additional shares

A reinvested payment creates another purchase to keep in your records. Include that purchase as its own lot when you want it represented in this arithmetic; the calculator does not add reinvestments automatically.

Keep the purchase date, share amount and actual purchase cost in your records. For the U.S. tax treatment of shares obtained through a dividend reinvestment plan, see the IRS dividend reinvestment basis explanation.

A forecast of future reinvestment is a separate calculation. The DRIP calculator models a scenario; it cannot reconstruct purchases that occurred in your account.

Check the rows before using the total

Use purchases of the same security in the same currency and on a consistent share basis. Review stock splits or other changes before combining older share quantities with newer ones.

Fractional shares are allowed. A zero-share row contributes nothing to either total. The average is shown as zero when there are no shares, because no average purchase price can be calculated.

The calculation does not convert currencies, merge broker records or validate the accuracy of your inputs. Preserve the original lot records even when one average is convenient to read.

The worked example was checked against Groverow's current calculation on 8 September 2026. This is purchase-cost arithmetic, not a tax return or investment recommendation.