Finance calculator

Free stock average cost calculator

Calculate the average cost per share after multiple purchases — enter share counts and prices to find your average cost basis, updated live, as you type.

InputsLive
Price/share
$
Shares
$
$
Current price (optional)
$
Result
Average cost
$49.44
45 shares · Total: $2,225
Average cost$49.44
Total shares45
Total invested$2,225
Gain/loss+$115

For informational purposes only. Not investment advice. Gains/losses shown before taxes.

Results are estimates. Consult a professional.

How it's calculated

How the stock average cost calculator works

When you buy shares of the same stock at different prices over time — a strategy called dollar-cost averaging (DCA) — your average cost per share is simply the total amount invested divided by the total number of shares purchased. This single number tells you the break-even price: the stock must trade above your average cost for your overall position to be profitable.

The average cost method is also the default tax-lot accounting method for mutual funds and is widely used for brokerage accounts. Knowing your average cost basis helps you calculate capital gains or losses when you sell, and tells you whether adding shares at the current price will raise or lower your break-even.

Average cost per share = Total amount invested ÷ Total shares purchased
Total amount invested = Σ (shares_i × price_i) for each purchase i
Total shares = Σ shares_i
Break-even price = Average cost per share
Unrealised gain/loss = (Current price Avg cost) × Total shares
IRS Publication 550 — Investment Income and Expenses: cost basis methods for securities.
Example

Worked example: two purchases at different prices

Example: 100 shares at $50, then 150 shares at $40

Taylor buys 100 shares of a stock at $50 per share for a total of $5,000. Two months later the stock dips and Taylor buys an additional 150 shares at $40 per share ($6,000). What is the average cost per share across both purchases?

Total invested = (100 × $50) + (150 × $40)
= $5,000 + $6,000 = $11,000
Total shares = 100 + 150 = 250
Avg cost/share = $11,000 ÷ 250 = $44.00
$44.00 / share
By adding shares on the dip, Taylor reduced their average cost from $50 to $44 — the stock only needs to recover to $44 (not $50) for the overall position to break even.
Quick reference

Dollar-cost averaging scenario: four purchases

The table below shows a running average cost calculation across four purchases of the same stock. Notice how buying more shares at lower prices pulls the average down, while buying at higher prices pushes it back up.

PurchaseShares BoughtPriceAmount InvestedTotal SharesRunning Avg Cost
1100$50.00$5,000100$50.00
2150$40.00$6,000250$44.00
380$55.00$4,400330$46.06
4120$45.00$5,400450$45.78

Source: Average cost per share formula — running total invested ÷ running total shares. Brokerage commissions excluded for clarity.

Practical tips

Tips for tracking and using average cost

Knowing your average cost per share is useful for planning entries, exits, and tax reporting. These tips help you use it correctly in each context.

  • Use average cost to set realistic profit targets — Your break-even is the average cost, not the price of your first purchase. If you've been averaging down, your target may be much lower than you think, making a return to profit faster.
  • Confirm your broker's cost-basis method — Brokers default to different lot-tracking methods (average cost for mutual funds, FIFO for stocks in many cases). The IRS requires you to specify your method before selling; mismatches can create unexpected tax bills.
  • Averaging down in falling stocks is a double-edged sword — Buying more of a declining stock lowers your average cost but increases your total exposure. Ensure the reason for the decline is temporary (market-wide) rather than fundamental to the company.
  • Re-check after corporate actions — Stock splits, reverse splits, spin-offs, and return-of-capital dividends all adjust your cost basis. Your brokerage should track these automatically, but verify after any corporate action.
  • Export purchase history for tax documentation — Keep a running log of every purchase (date, shares, price, commissions) even if your broker tracks it. This data is essential for calculating capital gains — especially if you switch brokers, who may not inherit your historical cost basis.
Accuracy & limits

Accuracy and limitations

This calculator uses the average cost basis method — total dollars invested divided by total shares — which is mathematically exact for the inputs provided. It does not apply FIFO, LIFO, or specific-lot accounting, which can produce materially different cost bases and tax outcomes when you sell only some of your shares. The calculator also does not account for brokerage commissions (which are typically added to cost basis), dividend reinvestment, return-of-capital distributions, or corporate actions such as stock splits. For authoritative cost-basis figures for tax reporting, use your brokerage's official statements.

Not financial advice — consult a financial professional for your specific situation.

Glossary

Key terms for average cost and DCA

Total dollars invested in a stock divided by total shares held. Your break-even price — the market price above which your position is profitable.
An investment strategy of buying a fixed dollar amount of a security at regular intervals regardless of price. DCA automatically purchases more shares when prices are low and fewer when prices are high.
The original value of an asset for tax purposes, typically the purchase price plus commissions. Used to calculate capital gains or losses when the asset is sold.
A cost-basis method that assumes the first shares purchased are the first sold. Often the default for brokerage accounts holding stocks; can result in higher taxable gains if early shares were cheaper.
Buying additional shares of a stock whose price has fallen below your original purchase price, reducing your average cost per share. Amplifies both gains and losses if the trade is larger.
The difference between the current market value and your cost basis for shares you still hold. Not taxable until you sell; can change daily with the stock price.
About

About this stock average cost calculator

This calculator runs entirely in your browser — nothing you enter is sent to any server.

Part of our finance calculators suite — explore all calculators.

Questions

Frequently asked questions about the free stock average cost calculator

A stock average cost calculator is a free online tool that helps you calculate weighted average cost per share from multiple lot purchases. Used to find cost basis for capital gains calculation. It runs entirely in your browser with instant results and no sign-up.
No — actual loan terms depend on credit, income docs, and lender underwriting. Use this for planning and what-if scenarios; get a real Loan Estimate before making decisions.
When the calculator asks for them. PITI calculations include property tax, insurance, and PMI; raw P&I calculations don't.
Lenders round payment amounts and may include escrow buffers. Property tax and insurance change over time. Real payments vary 1-5% from these estimates.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.