Crypto Tax Basis Calculator (FIFO / LIFO / HIFO / Spec ID)

Compare the capital gain on a crypto sale under FIFO, LIFO, HIFO, and specific-identification cost-basis methods from your purchase lots. Educational, not tax advice. Runs in your browser.

Purchase lots (in order acquired)

3 units held in 3 lot(s).

Proceeds: $40,000.00
FIFO
oldest lots first ยท basis $20,000.00
Gain $20,000.00
LIFO
newest lots first ยท basis $10,000.00
Gain $30,000.00
HIFO
highest cost first โ€” minimizes gain ยท basis $30,000.00
Gain $10,000.00
Spec ID (LOFO)
lowest cost first โ€” maximizes gain ยท basis $10,000.00
Gain $30,000.00

Capital gain = sale proceeds โˆ’ cost basis. The method only changes which lotsโ€™ cost is used: FIFO sells oldest first, LIFO newest, HIFO highest-cost (minimizing the gain), and Specific Identification lets you choose โ€” the LOFO variant shown sells lowest-cost lots (maximizing the gain). The IRS default is FIFO unless you can specifically identify lots. Short- vs long-term treatment (the 1-year holding rule) and wash-sale rules are not modeled here. Educational, not tax or investment advice. Everything runs in your browser.

About this tool

When you sell cryptocurrency you have bought in multiple batches at different prices, the taxable capital gain depends on which purchase 'lots' the sale is matched against โ€” and you often have a choice of accounting method, each producing a different gain. This calculator takes your purchase lots (units and cost per unit, in the order you acquired them) and a sale (units and sale price) and shows the resulting gain under four common cost-basis methods. The gain itself is always sale proceeds minus cost basis; the method only decides which lots' cost is consumed. FIFO (first-in, first-out) sells your oldest coins first and is the IRS default when you cannot specifically identify lots. LIFO (last-in, first-out) sells your newest coins first. HIFO (highest-in, first-out) sells your highest-cost coins first, which minimizes the reported gain (or maximizes the loss) and is therefore often the most tax-efficient in a single year. Specific identification lets you hand-pick which lots to sell, giving the most control; the LOFO (lowest-in, first-out) variant shown here sells your cheapest coins first and maximizes the gain, illustrating the other end of the range. To use HIFO or specific identification, tax rules generally require you to have adequate records identifying the specific units sold. This tool deliberately does not model the short- versus long-term holding-period distinction (the one-year rule that changes the tax rate) or wash-sale rules, and tax law varies by country and changes over time. It is educational and explicitly not tax or investment advice โ€” consult a qualified tax professional. Everything runs in your browser; nothing is uploaded.

How to use it

  • Enter each purchase lot: the number of units and the cost per unit, in the order you bought them.
  • Add or remove lots as needed.
  • Enter the number of units sold and the sale price per unit.
  • Compare the capital gain under FIFO, LIFO, HIFO, and the specific-ID (LOFO) method.

Frequently asked questions

What is cost basis and how does it affect crypto taxes?
Cost basis is what you originally paid for the units you sell, including fees. Your capital gain is sale proceeds minus cost basis. When you bought at different prices, the accounting method (FIFO, LIFO, HIFO, Spec ID) determines which purchase costs are used and therefore the size of the gain.
What is the difference between FIFO, LIFO, and HIFO?
FIFO sells your oldest coins first, LIFO sells your newest first, and HIFO sells your highest-cost coins first. HIFO produces the smallest gain (or largest loss) for a given sale, which is often the most tax-efficient within a single tax year.
What is specific identification (Spec ID)?
Specific identification lets you choose exactly which lots to sell, provided your records identify the specific units. It gives the most control over the gain. The LOFO (lowest-in, first-out) option shown is one Spec-ID strategy that sells cheapest coins first, maximizing the gain.
Which method does the IRS use by default?
For US taxpayers, FIFO is the default if you cannot specifically identify the units sold. Using HIFO or specific identification generally requires contemporaneous records identifying which coins were sold. Rules differ by country.
Does this account for short- vs long-term gains?
No. This tool computes the cost basis and gain only. It does not model the one-year holding period that separates short-term from long-term capital gains rates, nor wash-sale or other special rules.
Is this tax advice?
No. It is an educational calculator. Tax law is complex, country-specific, and changes. Consult a qualified tax professional. Nothing is uploaded; all math runs in your browser.

Related tools