Crypto FIFO Profit Calculator
Enter buys and sells to calculate FIFO profit, cost basis, and remaining portfolio.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulHow to Use the FIFO Calculator
The crypto FIFO calculator turns your transaction list into concrete numbers: it shows how much you made or lost on each sale, the cost of the units used, and what remains in your portfolio. Everything is calculated locally in your browser.
Here is the step-by-step process:
- Enter your transactions in the text box. One transaction per line.
- For each line, provide the transaction type, the price per unit, and the quantity, in that order.
- Use buy for purchases and sell for sales.
- When the list is ready, click the 'Calculate FIFO' button.
- Read the results for each sale, the total result, and the remaining portfolio.
The field starts with five sample lines. You will see the result for them as soon as the tool opens — treat it as a warm-up before entering your own data. Amounts are shown in US dollars by default.
How to Prepare Buy and Sell Transactions
The FIFO method matches sales against purchases in chronological order, so the order of lines matters. Enter transactions as they happened in time: oldest purchases at the top, then sales, later purchases, and later sales.
Each line is one transaction described by three parts:
- transaction type — buy for purchases; sell for sales,
- price per unit — the price at which you bought or sold one coin,
- quantity — how many units the transaction covers.
The sample set in the tool looks like this:
- buy, 100, 1
- buy, 200, 1
- sell, 150, 1.5
- buy, 120, 2
- sell, 300, 1
You can overwrite this data with your own or add more lines. Keep the oldest purchases higher in the list — their order determines the cost assigned to each sale. If you traded on several exchanges, enter everything in one list so that the chronological order is preserved.
How the FIFO Queue and FIFO Cost Work
FIFO stands for 'first in, first out.' Picture a queue of purchases: each sale takes units from the front of the line, starting with the oldest ones, until it has enough units.
FIFO cost is the sum of products: the number of units used from a given purchase times that purchase price. If you sell more than the oldest purchase has left, the queue moves to the next purchase, and then the next.
Let's walk through the default data:
- Buy 1 unit at $100.00.
- Buy 1 unit at $200.00.
- Sell 1.5 units at $150.00 gives revenue of 1.5 × $150.00 = $225.00. The queue uses 1 unit at $100.00 and 0.5 units at $200.00, so FIFO cost is $100.00 + $100.00 = $200.00. Profit is $225.00 − $200.00 = $25.00.
- Buy 2 units at $120.00.
- Sell 1 unit at $300.00 gives revenue of $300.00. The queue holds 0.5 units at $200.00 and 2 units at $120.00, so it uses 0.5 units at $200.00 ($100.00) and 0.5 units at $120.00 ($60.00), for a total of $160.00. Profit is $300.00 − $160.00 = $140.00.
This shows the core of the method: the same sale can be fully covered by one purchase or by several, and the order in which you bought determines the cost.
How to Read Profit, Loss, and Remaining Portfolio
For each sale, the calculator shows three numbers: revenue, FIFO cost, and profit or loss. Revenue is the sale price times quantity, FIFO cost is the value of the oldest purchases used, and profit or loss is the difference between them.
| Sale | Revenue | FIFO cost | Result |
|---|---|---|---|
| 1.5 units at $150.00 | $225.00 | $200.00 | profit $25.00 |
| 1 unit at $300.00 | $300.00 | $160.00 | profit $140.00 |
The total result is the sum of profits and losses from all sales. For the default data, that is a profit of $165.00, or $25.00 + $140.00.
At the end, the tool shows the remaining portfolio: the units that no sale used. In our example, 1.5 units remain at a cost of $180.00, or an average of $120.00 per unit. The average price is the remaining cost divided by the remaining quantity. This is useful when you want to see how much of your purchases is still waiting to be matched.
If you sell below FIFO cost, a loss appears instead of a profit — the calculation works exactly the same way.
Limitations and What the Tool Does Not Calculate
The calculator calculates exactly what you enter: prices, quantities, and transaction order. Beyond that, it has clear limits you should know before relying on the result.
- It does not add exchange fees or commissions — if you want to include them, adjust the prices you enter.
- It does not calculate taxes or create any tax return.
- It does not know current exchange rates or price lists — it works only with your numbers.
- It does not know your individual circumstances: allowances, exemptions, additional costs, or how you keep records.
- It does not import files from exchanges — you enter transactions manually.
The result is therefore an approximate reference point for portfolio analysis, not a finished tax document.
Crypto tax rules differ by country. The FIFO method is used, for example, in the US and the UK and in portfolio accounting, while some countries do not match specific units at all — in Poland (PIT-38), for instance, total purchase costs are simply subtracted from total sales proceeds for the year and crypto-to-crypto swaps are tax-neutral. Always check the rules that apply to you or ask a tax advisor.
Frequently Asked Questions
What is a crypto FIFO calculator?
It is a tool where you enter your purchases and sales, and it uses FIFO to calculate how much you made or lost on each sale. It also shows the cost of the purchases used and what remains in your portfolio.
Does Poland use FIFO for crypto taxes?
No. Poland reports crypto income on PIT-38: income is total sales proceeds for the year minus total acquisition costs, without matching specific units, and crypto-to-crypto swaps are tax-neutral. FIFO is used, for example, in the US and the UK and in portfolio accounting.
How is FIFO cost calculated for a sale?
Each sale uses the oldest available purchases. FIFO cost is the sum of products: the number of units used from a given purchase times that purchase price. If the oldest purchase has fewer units than you are selling, the queue moves to the next purchase.
Does the calculator include exchange fees and taxes?
No, it does not add fees, commissions, or taxes. It calculates only from the prices and quantities you enter. If you want to include fees, adjust the prices you enter.
What does the remaining portfolio show?
It shows the units that no sale used, along with their total cost and average price. The average price is the remaining cost divided by the remaining quantity. This lets you see how much of your purchases is still waiting to be matched.
Is my data sent anywhere?
No. Calculations run locally in your browser based on the transactions you enter in the text box. Nothing is sent or stored.
See also — related tools
Results are approximate and do not constitute tax advice; FIFO is an accounting method used in the US and the UK, among others, and Poland's PIT-38 reporting requires a separate calculator.