Skip to content
Investments

Stock Average Calculator

Calculate the average price of your stock purchases. Free online stock average calculator for investors.

Enter each stock purchase with shares and price per share. The calculator finds your weighted average cost basis.

Purchase 1

$

Purchase 2

$
$

Average cost per share

$46.67

150 shares, $7,000.00 total cost

Total shares

150

Total cost basis

$7,000.00

Current market value

$8,250.00

Unrealized gain or loss

$1,250.00

17.86% vs cost basis

Purchase breakdown

PurchaseSharesPriceCost
#1100$50.00$5,000.00
#250$40.00$2,000.00
Report tool

What is average cost basis for stocks?

Average cost basis is the weighted average price you paid per share across multiple stock purchases. Investors use it to track total position cost, estimate unrealized gains or losses, and simplify tax reporting when using the average cost method where permitted.

Compare with the dollar cost averaging calculatorfor planned recurring investments. To estimate capital gains tax on a sale, use the capital gains calculator. To review overall portfolio performance, try the rate of return calculator.

Weighted average cost formula

Average Cost=(sharesi×pricei)sharesi\text{Average Cost} = \frac{\sum (\text{shares}_i \times \text{price}_i)}{\sum \text{shares}_i}

Total cost equals the sum of each purchase (shares times price per share). Average cost per share equals total cost divided by total shares. Unrealized gain or loss equals current market value minus total cost.

Worked example

You buy 100 shares at $50 and later 50 shares at $40. Total cost is ($50 times 100) plus ($40 times 50), which equals $7,000. Total shares are 150. Average cost per share is $7,000 divided by 150, or $46.67. If the current market price is $55, market value is $8,250 and unrealized gain is $1,250.

Average cost vs FIFO

Average cost blends all purchases into one per-share figure. FIFO (first in, first out) matches sales against the oldest lots first. Tax treatment depends on your jurisdiction and broker reporting. Consult a tax professional before choosing a cost basis method for actual filings.

Frequently asked questions

Does average cost include trading commissions?
This calculator uses the price per share you enter. If you paid commissions, add them to total cost or increase the per-share price to reflect all-in cost.
Can I add more than two purchases?
Yes. Click Add purchase to include as many lots as needed. Each row updates the weighted average automatically.
How is unrealized gain calculated?
Unrealized gain equals total shares times current market price minus total cost basis. A negative value means an unrealized loss.
Is average cost the same as dollar-cost averaging?
No. Dollar-cost averaging is an investment strategy of buying fixed amounts on a schedule. Average cost basis is the math result of blending multiple purchase prices.
Are my purchase details stored?
No. All calculations run in your browser. Purchase data is encoded in the page URL so you can share your scenario.

Resources and references

The formulas and methods in this calculator were checked against these independent sources.