Skip to content
Omnikalc

Average cost calculator: average share price after several buys

Enter up to four purchases of the same stock or fund to get your average cost per share, including fees, and your gain at today's price.

Updated on
Your inputs

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Value out of range

$

Value out of range

$

Value out of range

$

Value out of range

Results

Average cost per share

$117.78

Unrealized gain or loss

$325.00

In profit
Total shares
45.00
Total invested, fees included
$5,300.00
Market value at the current price
$5,625.00
Gain or loss in %
6.13%

Gain at other prices

Market value at the current priceUnrealized gain or loss
90 current$4,050.00-$1,250.00
100 current$4,500.00-$800.00
110 current$4,950.00-$350.00
118 current$5,310.00$10.00
125 current$5,625.00$325.00
150 current$6,750.00$1,450.00

Why your average cost matters

If you buy the same stock or fund several times at different prices, each purchase has its own cost. Your average cost per share (also called cost basis per share) combines them into one number: the price the stock has to reach for your whole position to break even. It is the reference for deciding whether to buy more, how far a position is from recovery and, in many cases, what gain you will report when you sell.

The formula

  • Average cost = (sum of shares × price for each purchase + all fees) ÷ total shares
  • Unrealized gain = total shares × current price − total cost
  • Gain in % = gain ÷ total cost

The calculator accepts up to four purchases and adds a fixed fee for each one you fill in. Leave unused rows at zero.

Worked example

An investor bought the same stock three times:

Purchase Shares Price Cost
1 10 $150 $1,500
2 15 $120 $1,800
3 20 $100 $2,000
Total 45 $5,300
  1. Average cost = $5,300 ÷ 45 = $117.78 per share. It is not the plain average of the three prices ($123.33), because more shares were bought at the lower prices.
  2. At today’s price of $125, the position is worth 45 × $125 = $5,625.
  3. Unrealized gain: $5,625 − $5,300 = $325, or +6.13%.

Averaging down and up

Buying more after a fall lowers your average cost. That shortens the way back to break-even if the stock recovers, but it also concentrates more money in a falling position. Before averaging down, ask whether you would buy the stock today if you did not already own it. Buying at regular intervals regardless of price (dollar-cost averaging) is different: it is a plan, not a reaction.

Average cost and taxes

For mutual fund shares and dividend reinvestment plans, you can elect the average cost method on your tax return. For individual stocks, the IRS default is first in, first out (FIFO): the shares you bought first are treated as sold first, unless you tell your broker which lots to sell (specific identification). Your realized gain can therefore differ from what the average cost suggests. Commissions and fees paid to buy are part of your basis and reduce the taxable gain.

Use the capital gains tax calculator to estimate the tax on a sale.

Frequently asked questions

How do you calculate the average cost of a stock?

Add what you paid for every purchase, fees included, and divide by the total number of shares. 10 shares at $150, 15 at $120 and 20 at $100 cost $5,300 for 45 shares, or $117.78 each.

Does selling shares change my average cost?

Not under the average cost method: the remaining shares keep the same average. For individual stocks, the IRS default is first in, first out, so your taxable gain can differ from what the average suggests.

Should I include commissions?

Yes. Commissions and fees paid to buy shares are part of your cost basis, which lowers your taxable gain when you sell.

What is averaging down?

Buying more shares after the price falls, which lowers your average cost. It speeds up the return to break-even if the price recovers, but it also raises your exposure to a stock that is falling.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.