Calculator
Example Data Table
| Date | Type | Asset | Qty | Unit price | Fee | FX | Lot ID |
|---|---|---|---|---|---|---|---|
| 2025-01-18 | BUY | BTC | 0.50 | 40,000 | 25 | 1 | LOT-A |
| 2025-05-08 | BUY | BTC | 0.30 | 45,000 | 18 | 1 | LOT-B |
| 2026-02-11 | SELL | BTC | 0.40 | 62,000 | 30 | 1 | — |
| 2025-11-03 | BUY | ETH | 2.00 | 2,200 | 6 | 1 | LOT-C |
| 2026-02-21 | SELL | ETH | 1.20 | 2,800 | 5 | 1 | LOT-C |
Use these rows to test matching rules, long-term days, and tax rates.
Formula Used
- Buy lot cost = (Quantity × Unit Price + Fee) × FX Rate
- Lot unit cost = Buy lot cost ÷ Quantity
- Sell proceeds = (Quantity × Unit Price − Fee) × FX Rate
- Matched cost basis = Σ(Matched Quantity × Lot unit cost)
- Realized gain/loss = Sell proceeds − Matched cost basis
- Holding days = Sell date − Buy date (in days)
- Estimated tax = max(0, Net Short)×Short Rate + max(0, Net Long)×Long Rate
How to Use This Calculator
- Set your reporting currency, holding threshold, and tax rates.
- Add transaction rows for each buy and sell.
- Enter fees and an FX rate when prices are in another currency.
- Choose FIFO, LIFO, or HIFO for lot matching.
- Press Calculate to see totals and lot-level breakdown.
- Download CSV or PDF for records and filing support.
FAQs
1) What does this calculator compute?
It matches sell transactions to earlier buy lots, then calculates proceeds, cost basis, and realized gains or losses. It also separates short-term and long-term results and estimates tax using your rates.
2) Which cost basis methods are supported?
You can use FIFO, LIFO, or HIFO. The method changes which buy lots are consumed first when a sell occurs, which can change taxable gains significantly.
3) How are fees handled?
Buy fees increase cost basis, while sell fees reduce proceeds. This makes the final gain/loss more realistic for exchange trading and on-chain costs.
4) What if I sold more than I bought?
The tool warns you and assumes zero cost basis for the unmatched quantity. This is a conservative placeholder; you should correct the missing buys or import complete history.
5) How does FX rate affect results?
Each row’s FX rate converts prices and fees into your reporting currency. This helps when you traded using different currency pairs or exchanges.
6) Can I target a specific lot?
Yes. Give a buy row a Lot ID, then enter that same ID on a sell row. The calculator will try to consume that lot first, then apply your chosen method for any remaining quantity.
7) What does “carryover” do?
If enabled, your available loss carryover offsets current net gains before tax is estimated. The tool applies it to net short-term gains first, then to net long-term gains.
8) Is this a substitute for professional advice?
No. It’s a planning calculator for organizing trades and checking totals. Laws and reporting rules differ by country, and special situations may require a qualified tax professional.