InfyCalculator
💹

Stock Cost Basis Calculator

Combine multiple buy lots and commissions into a single average cost basis per share — the number you need for taxes and profit tracking.

Lot 1 — shares
Lot 1 — price per share
Lot 2 — shares
Lot 2 — price per share
Lot 3 — shares
Lot 3 — price per share
Total commissions & fees
Loading calculator…

How it works

Cost basis per share = (Σ shares × price + fees) ÷ total shares

Cost basis is the total you paid for a position, including commissions, divided by the number of shares. Because most brokers report gains against average basis for identical shares, adding lots at different prices blends into one per-share number. Fees are part of your basis — they raise it, which lowers your taxable gain when you eventually sell.

Worked example

Buy 100 shares at $50 ($5,000) and 50 at $40 ($2,000) for 150 shares and $7,000. With no fees, the average cost basis is 7,000 ÷ 150 = $46.67 per share.

Frequently asked questions

Should commissions be included in cost basis?

Yes. Purchase commissions and fees add to your cost basis, which reduces the capital gain you report when you sell. Selling fees reduce your proceeds instead.

Is this average basis or specific-lot basis?

This computes the average cost across all lots. Some brokers let you sell specific lots (specific identification) to control which basis is used for tax; that can beat the average when lots have very different prices.

What about stock splits or reinvested dividends?

A split changes your share count and per-share basis but not the total. Reinvested dividends are new lots at their reinvestment price and raise your total basis — add them as additional lots.

Related calculators

Educational estimate, not investment advice. Returns are hypothetical and not guaranteed.