WIN · WIN · WIN / TOOLS

Cost-Basis / Gain Calculator

Blank ledger sheets beside three measured tokens

For readers checking arithmetic across acquisition lots. The ledger must contain only the remaining, unconsumed holdings before this illustrative sale.

Examples are hypothetical. CU = currency units. Use one consistent currency wherever CU appears. No live prices or provider data are fetched.

Allocated acquisition cost3,250.00 CU
Net sale proceeds4,490.00 CU
Illustrative realised gain / loss1,240.00 CU
Remaining quantity1.50000000 asset units
Remaining acquisition cost3,750.00 CU

Illustrative result using the displayed default inputs.

How to read the result

The result illustrates allocation for the entered remaining lots and a single sale in one currency. It does not determine tax liability, a legally permitted accounting method, holding periods, FX treatment or adjustments for transfers, staking and corporate actions.

Formula

  1. Sum remaining lot quantities Q and total acquisition costs C. Sale quantity must not exceed Q.
  2. FIFO: consume lots oldest first; cost allocated from each lot = quantity consumed × lot total cost / lot quantity. Average: allocated cost = sale quantity × C/Q.
  3. Net sale proceeds = gross proceeds − sale fees. Illustrative realised gain/loss = net proceeds − allocated cost; remaining cost = C − allocated cost.

Worked example

Lots: 1 unit for 2,000 CU and 2 units for 5,000 CU. Sell 1.5 for 4,500 CU with 10 CU fees: FIFO cost = 2,000+0.5×2,500 = 3,250 CU; net proceeds = 4,490 CU; gain = 1,240 CU. Average cost = 3,500 CU; gain = 990 CU.

Worked examples

Read the detailed guide: Cost-basis arithmetic: FIFO and an average-cost illustration

Input specification and SEO alternatives
InputTypeUnitsDefaultLimits / choices
Lots in acquisition order: quantity, total cost including fees; one lot per lineMultiple input1–100 lots; quantity >0; total cost ≥0; values ≤1e121, 2000 2, 50001–5000 characters; 1–100 lots; quantity >0; total cost ≥0; values ≤1e12
Illustrative allocation methodChoiceNonefifoFIFO; Weighted average
Quantity soldnumberasset units1.51e-8–1000000000000
Gross sale proceedsnumberCU45000–1000000000000
Sale feesnumberCU100–1000000000000

Meta description

Illustrate FIFO or average-cost allocation and realised gain from entered acquisition lots and one sale. This is not a tax calculation.

SEO title alternatives

  1. Illustrative Cost Basis and Gain Calculator
  2. FIFO and Average Cost Calculator
  3. Crypto Gain Calculator: Educational Example

Outputs use English number formatting. Monetary amounts use two decimals; asset quantities use up to eight. Calculations retain unrounded intermediate values except the cent allocation stated for arbitrage.