Investing, DeFi & mining

Crypto Tax-Lot Calculator (FIFO, LIFO, HIFO) + Free Template

When you sell part of your crypto, which coins did you sell โ€” the ones bought first, the most recent ones, or the most expensive ones? The answer changes your realized gain. This calculator matches every sell to specific buy lots using FIFO, LIFO or HIFO, shows the gain or loss and holding period per lot, compares all three methods side by side and exports the result. It does not apply any country's tax rates โ€” it calculates the numbers you or your accountant need.

Download the free template: Crypto tax lot template (trades log)

Free, no sign-up, no e-mail โ€” a direct file link. Or fill it in online below.

CSV columns: date, type (buy/sell), quantity, price, fee. Header names can be in any order; the file never leaves your browser.

DateTypeQuantityPrice (USD)Fee (USD)
Realized gain / loss
$24,572.33
FIFO
Proceeds
$38,985.00
Cost basis: $14,412.67
Held โ‰ค 1 year
$2,994.83
Held > 1 year
$21,577.50

Same trades, other methods

Matched lots

Sell dateBuy dateQtyBuy priceSell priceCost basisProceedsGain / lossDays held
2024-06-202023-02-100.5$21,800.00$65,000.00$10,910.00$32,487.50$21,577.50496
2024-06-202023-11-050.1$35,000.00$65,000.00$3,502.67$6,497.50$2,994.83228

Remaining lots (unrealized)

Buy dateQty leftBuy priceCost per unit incl. fee
2023-11-050.2$35,000.00$35,026.67
2024-03-140.2$71,000.00$71,035.00

How to use it

Enter your trades in the table โ€” date, buy or sell, quantity, price per coin in USD and the fee in USD โ€” or import a CSV file. The expected columns are date, type, quantity, price and fee; header names are matched loosely, so files exported from most exchanges work after you rename or delete extra columns. Dates in 2024-03-14 or 14.03.2024 format are both understood. The file is read in your browser and never uploaded.

Use one asset per calculation (for example, only BTC trades). If a sell is larger than what you held at that date, the calculator warns you โ€” usually a deposit, transfer or earlier purchase is missing from the list.

FIFO vs LIFO vs HIFO explained

Each method decides the order in which your purchase lots are used up when you sell.

  • FIFO (first in, first out): the oldest coins are sold first. In a market that has risen over time, FIFO usually produces the largest realized gain, and the longest holding periods.
  • LIFO (last in, first out): the most recent purchases are sold first. It often realizes smaller gains in a rising market but leaves old, cheap lots unsold.
  • HIFO (highest in, first out): the most expensive lots are sold first, which minimizes the realized gain (or maximizes the loss) for that sale.

How the gain on each lot is calculated

A buy fee is added to the cost of that lot, so the cost per unit includes what you paid to acquire it. A sell fee reduces the proceeds of that sale and is shared proportionally between the lots it consumes. Holding days are counted from the buy date to the sell date; lots held more than 365 days are flagged as long-term because several jurisdictions treat them differently.

cost per unit = (qty ร— buyPrice + buyFee) / qty proceeds/unit = (qty ร— sellPrice โˆ’ sellFee) / qty gain per match = matchedQty ร— (proceeds/unit โˆ’ cost per unit)

Example

You bought 0.5 BTC at $21,800, 0.3 BTC at $35,000 and 0.2 BTC at $71,000, then sold 0.6 BTC at $65,000. FIFO uses the 0.5 lot and 0.1 from the second lot: a large gain, mostly long-term. LIFO first uses the $71,000 lot (a loss on that part) and then 0.3 at $35,000 and 0.1 at $21,800. HIFO picks the same lots here, because in this history the newest lots are also the most expensive โ€” with a dip-buy in the middle the two methods would diverge. The โ€œSame trades, other methodsโ€ chips show the realized total for each method instantly, so you can see how much the choice matters for your own history.

Important limits

Which method you may use is decided by your tax rules, not by preference. Some countries require FIFO, others use an average-cost or pooling method, and some allow specific identification only with records made at the time of the trade. Swapping one coin for another is often a taxable disposal too, as is paying for goods with crypto. Use these results as a working file, check the method that applies to you and keep the exported table with your records.

Crypto-to-crypto swaps can be entered as a sell of the coin you gave up at its USD value at that moment, and a buy of the coin you received at the same value.

Free trade-log template (Excel and CSV)

The template above is a trade log in exactly the format the calculator imports: date, type (buy or sell), quantity, price and fee. Keep your trades in it during the year, then import the CSV here to match lots with FIFO, LIFO or HIFO. The Excel version adds a โ€œHow to useโ€ sheet and example rows you can delete. Free, no sign-up.

Frequently asked questions

+Which cost basis method gives the lowest gain?

Usually HIFO, because it sells the most expensive lots first. But you can only use a method your tax authority allows โ€” compare the totals with the chips under the results and check the rules that apply to you.

+What CSV format does the import accept?

A header row with date, type (buy/sell), quantity, price and an optional fee column, in any order. Commas, semicolons and tabs are detected automatically. Download the sample CSV to see the exact format.

+Does the calculator know my country's tax rate?

No, and deliberately so. It calculates realized gains, cost basis and holding periods. Rates, allowances and loss rules differ by country and change often, so apply them separately or with an advisor.

+How are fees treated?

Buy fees increase the cost basis of the lot; sell fees reduce the proceeds. Both are entered in USD.

+Is my trade history uploaded?

No. Files are read locally by your browser and all matching happens on your device.

+Can I download the template for free without registration?

Yes. The Excel (.xlsx) / CSV file is a direct link on this page: no account, no e-mail and no payment. You can also use the online version above and export your own numbers.

Calculations run entirely in your browser; nothing you type is sent to KOT.CASH. Results are estimates for information only and are not financial, tax or legal advice.

โ† All 33 crypto tools

Crypto Tax Lot Calculator โ€” FIFO/LIFO/HIFO, Excel Template