Cost Basis Calculator

Combine up to three purchase lots and fees to calculate total cost basis, average cost, market value and unrealized gain.

Enter up to three purchase lots

Every fee is added directly to the cost of its lot; all quantities represent the same asset.

Average cost per unit

$87.00

Total cost basis

$2,610.00

Total quantity

30

Current market value

$3,300.00

Unrealized gain or loss

$690.00

Unrealized return

26.44%

Result comparison

Average cost per unitUnrealized gain or loss

Cost-basis lots

Detailed values use the same assumptions as the summary above.

Cost-basis lots
LotQuantityPriceFeeLot cost
110$100.00$5.00$1,005.00
220$80.00$5.00$1,605.00
30$0.00$0.00$0.00

Tax basis can require adjustments for splits, reinvestment, wash sales, return of capital and jurisdiction-specific rules not modeled here.

Cost basis across lots

Total cost includes the fees entered for each purchase. Market value equals total quantity multiplied by current price.

Average cost with fees across multiple lots

The cost basis calculator adds quantity multiplied by purchase price for each lot, then includes the entered transaction fee. Dividing total cost by total quantity produces an average cost per unit. A current price is optional for calculating market value and unrealized gain.

This page is separated from a trade-preview calculator because its primary task is the accumulated basis of existing lots. It still provides only a mathematical basis. Tax reporting can require corporate-action and account-history adjustments that cannot be inferred from three purchase entries.

Cost basis across lots

Average cost = Σ(quantity × price + fee) ÷ Σquantity

Total cost includes the fees entered for each purchase. Market value equals total quantity multiplied by current price.

Unrealized gain is market value minus the calculated cost. Return percentage divides that gain by total cost.

Use weighted cost basis for multiple lots

Google results cover average stock price, cost basis, profit or loss, and tax relevance. This calculator summarizes the purchase lots you enter; official tax basis can require adjustments that are outside a simple weighted average.

Add total lot costs before dividing

Multiply each lot’s unit price by quantity, include fees if appropriate, total the costs, and divide by total units. Never average prices alone when quantities differ. Keep enough precision during the calculation and round only the displayed result.

Accounting method may differ

Specific-lot identification, corporate actions, reinvested distributions, wash-sale adjustments, and transferred shares can change reportable basis. Use brokerage records and current tax guidance for filing. The calculator is a planning aid for straightforward purchases.

Separate basis from market value

Cost basis measures invested cost; market value uses the current price. Their difference is an unrealized gain or loss before selling costs and taxes. A lower average after buying more also means greater capital exposure.

Lot data checklist

  • Enter every quantity and price.
  • Choose consistent fee treatment.
  • Preserve transaction records.
  • Verify tax adjustments separately.

How to compare scenarios

Save a baseline, then change only one input at a time: amount, rate, term, or recurring payment. Record the supporting outputs as well as the headline result—contributions, interest, total cost, remaining balance, or target date. This isolates the assumption that actually changes the decision instead of hiding it inside several simultaneous edits.

Do not tune every assumption until the calculator produces a preferred answer. Start with a cautious case, follow with a central case, and treat the favorable case as an upside scenario. A calculator result is not a lender quote, market forecast, or tax determination; actual dates, rounding, fees, contract rules, and required payments must be checked in primary documents.

Keep enough precision in the inputs and round only the output used for a decision. If the estimate supports a transaction, loan, tax calculation, or long-term plan, repeat it with figures from the contract or official statement. Any difference helps identify the assumption that still needs verification.

Adjustments to check separately

Stock splits

A split changes quantity and per-share basis without changing total basis. Enter already adjusted quantities and prices.

Reinvested distributions

Each reinvestment may create another lot. Combine only lots whose records you can accurately represent.

Tax-lot rules

Specific identification, FIFO, wash-sale adjustments and return of capital are not decided by this calculator.

Cost basis questions

Are fees included in cost basis?

Yes. Each entered fee is added to the cost of its purchase lot.

Can I use fractional shares?

Yes. Quantity fields accept decimal values.

Is the result ready for a tax return?

Not necessarily. Compare it with broker records and applicable tax adjustments.

Data sources

These primary sources explain the rules and concepts referenced by this calculator. The calculation itself uses only the assumptions entered above.

Updated: August 1, 2026