Stock Average Calculator

Calculate weighted average cost, total shares, cost basis, unrealized gain or loss, and the impact of an optional new purchase.

Enter one lot per line as shares and price, with an optional fee. Commas, tabs, semicolons, or an @ separator are accepted.

Optional price used to estimate position value and unrealized gain or loss.

Shares for a possible next purchase. Leave blank to analyze only existing lots.

Price for the possible next purchase.

Flat cost added to the possible next purchase.

Use 0 to 6 decimal places for displayed money and share amounts.

Optional label for the quantity, such as shares, units, or lots.

Symbol used for money values in the output and breakdown.

Cost-basis breakdown

Enter one or more share lots to calculate the weighted average cost.


Calculator

How it works

A stock average calculator totals the cash committed across each lot and divides that cost basis by the total shares acquired. Fees increase the cost basis because they are part of what you paid to build the position.

Use one line per lot with the share quantity, share price, and optional flat fee. Add a current or target price when you want a quick unrealized gain or loss estimate.

Average cost per share = total cost basis ÷ total shares

The optional new-purchase fields show how one additional buy would change total shares, total cost basis, and average cost per share before you place an order.


Question

Assumptions and limitations

This tool is for quick position planning with positive share quantities, non-negative prices, and optional flat fees. It does not fetch market quotes, adjust for dividends, splits, wash-sale rules, short positions, taxes, foreign exchange, margin interest, or account-specific rules.

Results are estimates for education and comparison only. They are not financial, tax, legal, or investment advice.

All calculations happen locally in your browser. Your lots, prices, and planning assumptions are not sent to a server.


Books

References