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.