Cost Basis Calculator

Average cost = total dollars in ÷ total shares, including DRIP. Click any i for detail.

Jump to result

Lots (averaged)

Purchases ($)
i
Purchases

Sum of buy principal (not including fees).

Commissions / fees ($)
i
Fees

Brokerage commissions and similar friction added to basis.

Shares bought
i
Shares

Shares from those purchases (not DRIP yet).

Reinvested dividends ($)
i
DRIP dollars

Dividends used to buy more shares.

Extra DRIP shares
i
DRIP shares

Shares acquired from reinvested dividends.

How to use this calculator

  1. Sum purchase dollars and share counts.
  2. Add commissions to fees.
  3. If DRIP is on, add reinvested dollars and extra shares.
  4. Read average cost per share.

Results explained

Average cost = (purchases + fees + reinvested dividends) ÷ (shares + DRIP shares). This is one averaging method — brokers also support specific-lot identification.

Quick reference: basis

Wash sales and inherited-step-up are not on this page.

ItemDetail
Average costTotal $ ÷ total shares
Specific ID / FIFONot modeled
Return vs basisSee ROI calculator
Retirement accountsBasis tracking differs in IRAs — this is a taxable-lot sketch

Profit vs invested: ROI calculator.

How the estimate is built

avg = (spent + fees + reinvest) / (shares + drip shares).

Example scenario

$12,500 for 100 shares, no fees or DRIP → $125.00/sh.

FAQ

Crypto lots?

Same averaging idea if you treat coins as the share count.

Splits?

Adjust shares (and maybe purchase history) before entering totals.

Capital gain?

Gain = sale proceeds − basis × shares sold — not computed here.