WIN · WIN · WIN / TOOLS
Cost-Basis / Gain Calculator
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.
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
- Sum remaining lot quantities Q and total acquisition costs C. Sale quantity must not exceed Q.
- FIFO: consume lots oldest first; cost allocated from each lot = quantity consumed × lot total cost / lot quantity. Average: allocated cost = sale quantity × C/Q.
- 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
| Input | Type | Units | Default | Limits / choices |
|---|---|---|---|---|
| Lots in acquisition order: quantity, total cost including fees; one lot per line | Multiple input | 1–100 lots; quantity >0; total cost ≥0; values ≤1e12 | 1, 2000
2, 5000 | 1–5000 characters; 1–100 lots; quantity >0; total cost ≥0; values ≤1e12 |
| Illustrative allocation method | Choice | None | fifo | FIFO; Weighted average |
| Quantity sold | number | asset units | 1.5 | 1e-8–1000000000000 |
| Gross sale proceeds | number | CU | 4500 | 0–1000000000000 |
| Sale fees | number | CU | 10 | 0–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
- Illustrative Cost Basis and Gain Calculator
- FIFO and Average Cost Calculator
- 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.