Enter values to see results
—
—
—
—
—
—
—
Enter values to see results
—
—
—
—
—
—
—
The Tax Lot Optimizer helps cryptocurrency investors minimize their tax liability by comparing three different cost basis accounting methods: FIFO (First In, First Out), LIFO (Last In, First Out), and HIFO (Highest In, First Out). When you sell cryptocurrency that was purchased across multiple transactions at different prices, the method you use to assign cost basis to the sold coins can dramatically affect your taxable gain -- and therefore your tax bill.
Every cryptocurrency purchase you make creates a tax lot -- a record of the date, quantity, and price of acquisition. When you sell, you must identify which specific lots you are selling to calculate your capital gain or loss. In the United States, the IRS allows specific identification of lots, meaning you can strategically choose which lots to sell to optimize your tax outcome. Similar flexibility exists in many other jurisdictions, though rules vary.
FIFO sells the oldest lots first. In a rising market, this typically results in the highest taxable gains because your earliest purchases were likely at the lowest prices. LIFO sells the newest lots first, which can be advantageous if recent purchases were at higher prices, reducing the gain. HIFO sells the highest-cost lots first, always minimizing the current taxable gain regardless of purchase order. HIFO is generally the most tax-efficient method for investors looking to defer taxes.
The difference between methods can be substantial. Consider an investor who bought Bitcoin at $20,000, $30,000, and $40,000 across three purchases and is now selling at $35,000. Using FIFO, the gain per coin is $15,000. Using HIFO, the gain is reduced to $0 or even a loss depending on the lot sold. For a 20-30% capital gains tax rate, this can mean thousands of dollars in tax savings. This calculator makes the comparison instant and visual, helping you make the optimal tax decision before executing your sell order.
The calculator compares three cost basis methods for the same sell transaction:
FIFO (First In, First Out): Sells shares from Lot 1 (earliest purchase) first, then Lot 2, then Lot 3. Cost Basis = sum of (quantity sold from each lot x that lot's price), processing lots in chronological order.
LIFO (Last In, First Out): Sells shares from Lot 3 (most recent purchase) first, then Lot 2, then Lot 1. Same formula but processing lots in reverse chronological order.
HIFO (Highest In, First Out): Sells shares from the highest-priced lot first, regardless of purchase date. This maximizes cost basis and minimizes taxable gain.
Capital Gain/Loss = Sell Proceeds - Cost Basis, where Sell Proceeds = Sell Price x Sell Quantity.
Tax Savings (HIFO vs FIFO) = FIFO Gain - HIFO Gain. This represents the reduction in taxable income by using HIFO instead of FIFO. Multiply by your marginal tax rate to estimate actual tax dollar savings.
If the sell quantity exceeds one lot, the calculation draws from multiple lots until the sell quantity is fulfilled.
The method with the highest cost basis produces the lowest taxable gain. In most market scenarios, HIFO produces the best tax outcome for current-year tax minimization. However, consider the long-term implications: lots held over one year may qualify for lower long-term capital gains rates (15-20% vs 22-37% short-term in the US). Sometimes selling a short-term HIFO lot at a small gain is less efficient than selling a long-term FIFO lot at a larger gain but lower rate. The tax savings shown represents the maximum possible reduction in taxable income by choosing the optimal method.
Inputs
Results
FIFO sells Lot 1 first (basis $10,000, gain $7,500). LIFO sells Lot 3 + part of Lot 2 (basis $15,000, gain $2,500). HIFO sells the $40K lot + part of $30K lot (basis $17,000, gain only $500). Tax savings: $7,000 less taxable income with HIFO.
Inputs
Results
At $25,000 sell price, FIFO shows a $1,500 gain. LIFO shows a $1,500 loss. HIFO maximizes the loss at $4,500 by selling the $40K lot first. HIFO creates $6,000 more in tax deductions than FIFO.
A tax lot is a record of a specific cryptocurrency purchase including the date, quantity, and price. Each buy order creates a new lot. When you sell, you must match the sold coins to specific lots to calculate your cost basis and capital gain or loss for tax purposes.
FIFO (First In, First Out) sells oldest lots first. LIFO (Last In, First Out) sells newest lots first. HIFO (Highest In, First Out) sells the highest-cost lots first. Each method produces different cost bases and therefore different taxable gains for the same transaction.
HIFO typically minimizes current-year taxes by maximizing cost basis and reducing the taxable gain. However, it defers (not eliminates) taxes, as your remaining lots have lower cost bases. Also consider long-term vs short-term holding periods, which affect the applicable tax rate.
Yes. IRS guidance permits specific identification of crypto lots if you can adequately identify the units sold. You must maintain records showing the date, quantity, and cost of each lot. Many exchanges and tax software (CoinTracker, Koinly, TaxBit) support specific identification.
Tax loss harvesting involves selling cryptocurrency at a loss to offset gains from other trades or up to $3,000 of ordinary income (US). Unlike stocks, crypto is not currently subject to wash sale rules (as of 2024), meaning you can immediately rebuy the same asset after selling at a loss.
Use crypto tax software like CoinTracker, Koinly, TaxBit, or CryptoTaxCalculator. These platforms import transaction history from exchanges via API, consolidate all lots, and calculate gains using your chosen method. Manual tracking via spreadsheets is possible but error-prone with many transactions.
Currently (as of 2024), the IRS wash sale rule (which prevents claiming losses if you rebuy within 30 days) does not officially apply to cryptocurrency. However, proposed legislation may extend wash sale rules to crypto in the future. Stay updated on regulatory changes.
In the US, you can use different identification methods for different wallets or exchanges. However, consistency helps with record-keeping and audit defense. Some tax advisors recommend choosing one method (usually HIFO or specific identification) and applying it consistently across all accounts.
US long-term capital gains (assets held >1 year) are taxed at 0-20%, while short-term gains are taxed at ordinary income rates (10-37%). Sometimes selling a long-term FIFO lot with a larger gain at the lower rate produces less tax than selling a short-term HIFO lot with a smaller gain at the higher rate.
For each transaction, record: date and time, quantity, price per unit, total cost (including fees), exchange or wallet used, and transaction hash if available. Keep records for at least 3 years after filing (7 years is safer). Export transaction histories from exchanges before closing accounts.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
Crypto Profit & Loss Calculator
Cryptocurrency & Blockchain Calculators
Crypto APR Calculator
Cryptocurrency & Blockchain Calculators
Futures PnL Calculator
Cryptocurrency & Blockchain Calculators
Liquidation Price Calculator
Cryptocurrency & Blockchain Calculators
Crypto Converter (Fiat/Crypto)
Cryptocurrency & Blockchain Calculators
Target Price Calculator
Cryptocurrency & Blockchain Calculators