Calculate cryptocurrency cost basis using FIFO or LIFO accounting. Enter buys and sales with dates and USD amounts, see which lots fund each disposal, days held per slice, remaining inventory, and compare net realized gain between methods before using our country tax calculators.
FIFO (first-in, first-out) sells the oldest lots first — default in the US and many countries. LIFO (last-in, first-out) sells the newest lots first — allowed in some jurisdictions. Compare both to see how method changes realized gain.
Enter each acquisition and disposal with date, quantity, and total USD. On buys, amount is what you paid including fees. On sales, amount is what you received after fees. Swaps count as a sell plus a buy.
$35,000.00 proceeds · $20,000.00 basis
Educational cost-basis math for planning and record-keeping — not tax advice. Your country may require FIFO, specific lot ID, HMRC pooling, or other rules. Use our geo tax calculators for estimates after you know your basis.
When you sell cryptocurrency, tax systems ask for gain or loss: proceeds minus cost basis. If you bought the same coin at different prices and dates, you must decide which purchase “funds” the sale. FIFO (first-in, first-out) uses your oldest unsold lots first — the default for many US taxpayers and a common method worldwide. LIFO (last-in, first-out) uses the newest lots first, which can lower or raise realized gain when prices rose over time. Some countries mandate one method; others let you choose within rules. This calculator does not file anything — it shows transparent lot-by-lot matching, holding period in days for each slice, inventory left on hand, and a side-by-side FIFO vs LIFO comparison so you can export numbers into our US, UK, Germany, or other tax calculators.
Transactions are sorted by date; on the same day, buys are processed before sales. Each buy creates a lot with quantity and total USD cost (fees included in the amount you enter). Each sale walks your open lots: FIFO consumes from the earliest lot until the sell quantity is filled; LIFO consumes from the latest lot. Cost assigned to the sale = sum of (lot cost × quantity taken ÷ lot quantity) for each slice. Proceeds for matched quantity = sale proceeds × (matched qty ÷ sale qty). Realized gain = matched proceeds − matched cost. Unmatched sale quantity (no inventory) is flagged with $0 basis. Remaining lots after all trades are your open inventory. Compare mode runs the full ledger twice and shows the difference in net realized gain.
Buy 0.5 BTC for $20,000 on 15 Jan. Buy 0.5 BTC for $32,000 on 1 Jun. Sell 0.5 BTC for $35,000 on 10 Sep.
FIFO matches the January lot: basis $20,000, gain $15,000. LIFO matches the June lot: basis $32,000, gain $3,000.
Same trade, $12,000 difference in reported gain — method matters for tax planning when lots have different costs.
Two 10 ETH buys at $25,000 and $30,000 total; sell 10 ETH for $40,000.
FIFO uses $25,000 basis (gain $15,000). LIFO uses $30,000 basis (gain $10,000).
Load the “ETH FIFO vs LIFO” preset to see match lines and holding days.
BTC buys and sells mixed with ETH buys — each ticker has its own lot pool.
FIFO/LIFO never crosses assets. Each symbol has its own inventory stack.
Enter the correct asset code on every row so matching stays accurate.
You swap USDC for SOL or pay a merchant in BTC.
Treat the outgoing coin as a sale at fair market value and the incoming coin as a new buy. Enter both legs if you model a swap.
This tool matches the disposal leg you enter; pair with a second buy row for the acquired coin.
For education only — not financial advice. Past performance does not guarantee future results.