Home / Free tools / Crypto cost-basis calculator (FIFO and LIFO)
Crypto cost-basis calculator: FIFO or LIFO lots in your browser
Enter your purchases as lots and your sales. The calculator applies FIFO or LIFO, shows which lots were used, what remains and the realised gain or loss in the same currency you used for costs. It is a working aid, not tax, accounting or legal advice.
How to use it
- List your purchases. One lot per line: date, quantity bought, total cost in one currency (fees included if you want them in the basis).
- List your sales. Date, quantity sold, total proceeds in the same currency.
- Choose FIFO or LIFO. FIFO uses the oldest remaining lot first; LIFO uses the newest. Use the method you actually apply in your records.
- Read remaining lots and realised gain. Then copy the figures into your own records. This page does not store them.
What cost basis is, in one paragraph
When you sell crypto, the taxable gain (in places that tax it) is usually proceeds minus cost basis: what those units cost you when you acquired them. Because coins are fungible, you need a rule for which purchase a sale comes from. FIFO (first in, first out) takes the oldest unsold lot first. LIFO (last in, first out) takes the newest. Some places allow or require specific identification of lots. This tool supports FIFO and LIFO only, and it treats every line as a buy or a sell in a single pool. It does not model transfers between your own wallets, which typically should not be sales.
How to avoid a misleading result
- Use one currency for every cost and proceeds figure, usually your filing currency, converted on the trade date.
- Put fees where your method puts them (often added to cost, or subtracted from proceeds).
- Do not list a transfer to another of your wallets as a sale.
- Income (mining, staking, airdrops, paid work) is usually a new lot at the value when you received it, not a purchase at zero.
A spreadsheet that keeps lots per wallet is easier to maintain than a one-off paste. The Crypto Wallet Ledger & Cost-Basis Tracker is built for that: lots, days held, gains by term and a year-end checklist. Same publisher, paid in crypto, no account.
Worked example
This is what the tool produces for the sample input, so you can see the result without running it.
Input
2024-01-10, 1, 10000 2024-07-01, 1, 20000
Result
Method: FIFO. Realised gain or loss: 25,000.00 on 1.5000000 sold, proceeds 45,000.00. Remaining: 0.50000000 with unmatched cost 10,000.00 (average 20,000.00 each).
Sales
| Date | Qty sold | Proceeds | Matched cost | Gain / loss | Lots used |
|---|---|---|---|---|---|
| 2025-01-01 | 1.5 | 45,000.00 | 20,000.00 | 25,000.00 | 1.00000 @ 10,000.00 from 2024-01-10; 0.500000 @ 20,000.00 from 2024-07-01 |
Remaining lots
| Bought | Quantity left | Unit cost | Unmatched cost |
|---|---|---|---|
| 2024-07-01 | 0.5 | 20,000.00 | 10,000.00 |
This is a calculator, not tax advice. Jurisdictions differ on method, transfers between wallets, income from staking or airdrops, fees, and the holding period that separates short-term from long-term gains. Check the rules that apply to you, or a qualified adviser, before filing.
Frequently asked questions
Is this tax advice?
No. It is a calculator that applies FIFO or LIFO to the numbers you enter. Tax treatment depends on where you live and the facts of each transaction.
Which method should I use?
Use the method required or chosen in your records and be consistent. This tool does not tell you which one is allowed.
Can I enter several wallets?
Not separately. It treats all lines as one pool. For per-wallet lots, use a ledger spreadsheet.
Is my history uploaded?
No. The calculation runs in your browser.
More free tools
- 50/30/20 budget calculator: Split take-home pay into 50% needs, 30% wants and 20% saving or debt. Compare your actual spending, or try custom percentages. Private, in your browser.
- Freelancer rate calculator: Turn a target income, billable hours, utilisation, time off and overhead into an hourly, daily and project rate. Private, in your browser.
- LLM token and cost estimator: Estimate tokens from pasted text and project the cost of an agent or prompt per run, per day and per month, with cached-input discount and growing context.