Trace a partial sale back to the lots it consumes
Global · Year-independent / dated user inputs · Rules reviewed 2026-11-12 · Rule revision 2026-11-12.1
Crypto holders reconciling a partial sale in a single account.
Independently checked examples · These fixed case studies do not change with your inputs above.
Inputs and preparation
Enter every purchase date, quantity, unit price and total quote-currency fee, then one sale. Use UTC and only one asset/account.
Enter each acquisition as its own dated lot with quantity, unit price and buy fee. Keep all money in the same currency. The sale must occur after the acquisitions used to cover it; an asset ticker does not fetch prices, identify wallets or reconcile transfers.
Formula
Lot basis = (units × unit price + purchase fee) × sold units / purchased units. FIFO consumes the earliest lots first. Net sale proceeds = units sold × sale price − sale fee. P/L = net proceeds − allocated basis.
Worked examples and comparisons
Partial sales consume the earliest lots
Illustrative BTC trades in USD: buy 1 on 2026-01-01 at 30,000 plus fee 30; buy 1 on 2026-02-01 at 40,000 plus fee 40. Sell on 2026-03-01. These prices are invented examples, not historical quotes.
| Sale quantity / unit price / fee | Allocated basis | Realized P/L | Remaining quantity | Remaining basis |
|---|---|---|---|---|
| 0.5 / USD 50,000.00 / USD 25.00 | USD 15,015.00 | USD 9,960.00 | 1.5 | USD 55,055.00 |
| 1.5 / USD 50,000.00 / USD 75.00 | USD 50,050.00 | USD 24,875.00 | 0.5 | USD 20,020.00 |
| 2 / USD 35,000.00 / USD 70.00 | USD 70,070.00 | USD -140.00 | 0.0 | USD 0.00 |
| 2.1 (held 2) | Rejected: oversell | No result | No result | No result |
What the comparison tells you
The hypothetical BTC lots are one unit at USD 30,000 plus a USD 30 fee and one at USD 40,000 plus a USD 40 fee. Selling 0.5 uses half the first lot’s USD 30,030 basis. Selling 1.5 consumes that lot fully plus half the second. The dates and prices are fictional inputs, not historical market data.
Realized profit subtracts the allocated buy basis and the sale fee once. Remaining basis belongs to unsold units and is not another expense on the same sale. The 2.1-unit example is rejected because only two units are available; it must not create negative inventory or a profit result.
Scope and limitations
FIFO is the only supported identification method. This is a transaction-cost tool, not a country-specific tax calculation or filing statement. Broker-specific rules, wallet transfers, staking, swaps and fees paid in crypto are excluded. Amounts use 60 significant digits internally and inputs allow up to 18 decimal places.
This is a FIFO transaction-cost model only. It does not determine whether FIFO is legally appropriate for your jurisdiction, compute tax, or cover staking income, transfers, airdrops and every corporate action. Preserve original records and use the CSV as a calculation record, not a tax certificate.
Frequently asked questions
Can I sell more coins than I entered?
No. Add the missing qualifying purchase or reduce the sale quantity. Later purchases cannot fund an earlier sale.
Is FIFO always the correct tax method?
No. Permitted methods, account scope and broker identification rules depend on jurisdiction and circumstances. This tool only models FIFO.
What happens to rounding and fees in CSV?
CSV retains internal decimal results. A proportional share of purchase cost and sale fees is assigned to each consumed lot; summary values use currency rounding and detailed lot amounts retain 8 places.
Examples last reviewed: . Rule and fee effective dates are listed in this guide and the calculator. The review date is not the effective date of every rule.