Skip to main content

FINANCIAL · STOCK AVERAGE CALCULATOR (COST BASIS)

Stock Average Calculator (Cost Basis)

Calculate the average cost per share across multiple stock purchases (lots), grouped by ticker. Enter each lot's ticker, price, and share count to find your weighted average cost basis, plus per-ticker and portfolio unrealized gain or loss.

Purchase Lots
Current Price per Ticker (optional)

Enter today's price for each ticker to see unrealized gain/loss. Leave blank to skip.

02 Result
Total invested
$15,000.00
2 tickers · 350 total shares
Unrealized gain
$3,250.00
+21.67%
Current value$18,250.00
Per-ticker cost basis and gain/loss breakdown
TickerSharesAvg costCurrentValueGain/Loss
AAPL150$46.67$55.00$8,250.00+$1,250.00
MSFT200$40.00$50.00$10,000.00+$2,000.00

About This Calculator

When you buy shares at different prices over time (dollar-cost averaging, averaging down, or multiple purchases), your effective cost per share is the weighted average across all lots — not a simple arithmetic average. Enter each purchase lot with its ticker, price, and share count; lots are grouped by ticker so you can track one stock or a whole portfolio. The calculator finds your true average cost basis per ticker, plus optional unrealized gain or loss when you enter today's price for each ticker.

How It Works

Enter the ticker, price per share, and number of shares for each purchase lot. Add as many lots as needed (2–25); lots that share a ticker are combined into one position. The calculator computes each ticker's weighted average cost using total cost ÷ total shares. A "current price per ticker" section appears with one row for each unique ticker you've entered — fill those in to see per-ticker and whole-portfolio unrealized gain/loss in dollars and as a percentage. A single ticker shows one headline average; multiple tickers show a per-ticker breakdown with portfolio totals.

The Formula

Avg cost = Σ(priceᵢ × sharesᵢ) / Σ(sharesᵢ) · Gain = (current − avg cost) × shares

priceᵢ
purchase price per share for lot i (within one ticker)
sharesᵢ
number of shares purchased in lot i
Avg cost
weighted average cost per share for a ticker
current
current market price per share for that ticker

Frequently Asked Questions

What is the average cost method for cost basis?
The average cost method calculates your cost basis as the total amount paid divided by the total number of shares held. It is the standard method for mutual funds and ETFs. For individual stocks, some brokerages default to FIFO (first in, first out) or let you choose specific identification, which can be more tax-efficient.
How does averaging down work?
Averaging down means buying more shares of a stock after its price has fallen, which lowers your average cost per share. This reduces the price increase needed to break even, but it also concentrates more capital in a losing position. Use this calculator to see exactly how additional purchases at different prices shift your average.
Does this include brokerage commissions?
No — the calculator uses the per-share price as entered. To include commissions in your cost basis (which is correct for tax purposes), add the commission to the total cost and divide by shares, or enter an adjusted per-share price that factors in the commission.
Can I use this for ETFs or mutual funds?
Yes. The average cost method applies to any security purchased in multiple lots — stocks, ETFs, or mutual funds. For mutual funds, the average cost basis is typically the only IRS-accepted method unless you specifically elected another method before the sale.
Can I track more than one ticker at once?
Yes. Enter a ticker for each lot and the calculator groups lots by ticker — lots that share a symbol combine into one position with its own average cost. Each unique ticker gets its own "current price" row, so you can see per-ticker and whole-portfolio gain/loss without blending different stocks into a single, meaningless average. Portfolio totals appear once every ticker has a current price entered.