Crypto Tax Lot Optimizer — FIFO vs LIFO vs HIFO Compare
Drop your crypto purchase lots (qty, cost basis, months held), the planned sell quantity, current price, and short / long-term tax rates. Calculator runs FIFO (default IRS fallback), LIFO (newest first), and HIFO (highest cost basis first) on the same sale, splits gains short vs long by the 1-year line, and surfaces the best method plus the dollar savings vs FIFO. Anchored to IRS Pub 544, Notice 2014-21, Rev. Rul. 2019-24, and CoinTracker / Koinly tax-engine documentation.
- Instant result
- Private — nothing saved
- Works on any device
- AI insight included
Crypto Tax Lot Optimizer
You might also need
What This Calculator Does
The Crypto Tax Lot Optimizer answers the single highest-leverage tax question in retail crypto trading: which of my purchase lots should I tag as ‘sold’ to minimize this year’s capital-gains tax? Drop your purchase lots (quantity, cost basis, months held), the planned sell quantity, current price, and your short / long-term tax rates. The calculator runs FIFO (the IRS default fallback), LIFO (newest lots first), and HIFO (highest cost basis first) on the same sale, splits gains short vs. long by the 1-year line, and surfaces the best method plus the exact dollar savings vs. FIFO.
Most retail crypto holders default to FIFO because the IRS uses it as the fallback when records don’t support specific-identification. That choice often costs $5,000-$50,000+ on a single sale in long-running portfolios, where early-buy lots have $20K basis and recent buys have $80K-$100K basis. The same 2.4 BTC sale taxes one way under FIFO ($34K) and another under HIFO ($11K) — a $23K spread that disappears entirely if you don’t elect specific-ID at the time of trade. This calc surfaces the spread so the elective decision happens with the dollar number visible, not buried in your tax software’s default settings.
The Math — FIFO vs LIFO vs HIFO Plus the 1-Yr Line
Three layers compound. Method choice determines which lots get assigned to the sale — FIFO and LIFO use chronology; HIFO uses cost basis. Holding period split then partitions the resulting gains into short-term (under 12 months, taxed at ordinary rates) vs. long-term (≥12 months, taxed at preferred capital- gains rates). Rate application multiplies each gain pool by its rate; the calc deliberately doesn’t cross-offset losses against gains in the per-sale rollup because the offset waterfall is annual, not per-trade. (The Tax-Loss Harvesting calculator covers the cross- offset waterfall in detail.)
Two metrics drive the verdict. Best-vs-FIFO savings tells you the dollar value of electing specific-identification: positive savings means the elective method wins and is worth the bookkeeping; zero or negative means FIFO is already optimal. Spread between best and worst tells you how much basis dispersion exists across your lots — wide spreads ($10K+) signal that method choice is high-leverage; tight spreads (under $200) signal that lots are similar enough that holding-period optimization (waiting for the 1-yr mark) is the bigger lever.
A Worked Example — “BTC accumulator selling 2.4 BTC”
Suppose you have 3 lots totaling 2.4 BTC, plan to sell all 2.4 at $100K BTC current price, and your tax rates are 32% short / 15% long (typical US working professional in a no-state-tax state):
- Lot 1: 1.5 BTC at $20K basis, held 36 mo (long-term)
- Lot 2: 0.5 BTC at $65K basis, held 18 mo (long-term)
- Lot 3: 0.4 BTC at $85K basis, held 8 mo (short-term)
- Proceeds: 2.4 × $100K = $240,000 (same across all methods)
Run each method:
- FIFO (oldest first → 1 → 2 → 3): sells lot 1 (1.5 BTC × $80K gain = $120K long), lot 2 (0.5 × $35K = $17.5K long), lot 3 (0.4 × $15K = $6K short). Tax: $137.5K × 15% + $6K × 32% = $22,545
- LIFO (newest first → 3 → 2 → 1): sells lot 3 (0.4 × $15K = $6K short), lot 2 (0.5 × $35K = $17.5K long), lot 1 (1.5 × $80K = $120K long). Same gain pools. Tax: $22,545 (identical here)
- HIFO (highest basis first → 3 → 2 → 1): sells lot 3 first (highest $85K basis → smallest gain), then lot 2, then lot 1. Same coins, same gain split — tax also $22,545
In this clean example all three methods land at the same total because the entire holding gets sold and each lot is fully depleted regardless of order. Method choice matters when sellQty < total held — that’s when the order of consumption picks which lots are realized vs. left untouched, and the dollar spread between methods opens up. Try the same lots with sellQty = 1.0 BTC and the spread becomes meaningful: FIFO sells 1.0 from lot 1 ($80K gain @ 15% = $12K tax); HIFO sells lot 3 first (0.4 × $15K = $6K short @ 32% = $1.9K) plus 0.6 from lot 2 ($21K @ 15% = $3.15K) = ~$5K total — a $7K savings on a $100K sale.
When This Is Useful
Six high-value moments. Pre-sale planning. Run the calc before placing the sell order. Most exchanges ( Coinbase, Kraken, Gemini) let you tag the specific lot at trade time; you cannot retroactively elect HIFO at year-end. The bookkeeping has to happen at the moment of trade. Year-end realization.Sweep through unrealized positions in November-December and run the calc on each. HIFO tends to win when you’re selling part of a multi-lot stack; FIFO often wins when liquidating an entire position. Just-past-1-yr-mark sales. If a lot crossed the 12-month threshold recently, method choice that prefers that lot saves the rate spread (32% → 15% = 17 pp on the gain). Run the calc with months-held = 13 vs. 11 to see the threshold effect. Multi-asset portfolios. Run separately per asset (BTC, ETH, SOL etc.). You can use FIFO on BTC and HIFO on ETH — but you must be consistent within each asset across the tax year. Mixing methods on the same asset mid-year invites audit risk. Pre-rebalance sanity check. Before swapping crypto for stablecoin or fiat, check the post-tax proceeds. A 200% nominal gain at 32% short rate nets ~136% after-tax; the same at 15% long rate nets ~170%. The 34 pp swing is exactly what holding 2-3 more months earns if you’re close to the 1-yr line. Audit defense preparation. Print the calc’s working-steps panel as a contemporaneous record showing the lot ID at sale time. Combined with exchange trade confirmation and acquisition records, this satisfies the IRS specific-ID requirement under Notice 2014-21 and Rev. Rul. 2019-24.
Common Mistakes
- Defaulting to FIFO without checking HIFO. FIFO is the IRS fallback when records are incomplete; it’s NOT the optimal default when you have records. In long-running portfolios with wide basis dispersion, FIFO routinely costs $10K-$50K extra vs. HIFO on a single 6-figure sale. Always run all three methods before electing.
- Trying to elect HIFO retroactively at year-end. IRS specific-identification requires contemporaneous records — you must identify the lot at the time of sale, not later. Most major exchanges support per-trade lot selection in their tax interface; aggregators like CoinTracker / Koinly automate this via API. If your exchange forces FIFO at trade execution, electing HIFO retroactively risks audit challenge.
- Ignoring the 12-month line on lots near the threshold. A lot at 11 months 28 days held is short-term; at 12 months 0 days it’s long-term. The rate jumps from 32% (ordinary) to 15% (long-term capital gains) — a 17 pp spread. On a $50K gain, that’s $8.5K saved by waiting 2 days. The calc surfaces months-held per lot so you can see which are close to the line.
- Mixing methods on the same asset within a tax year. Once you elect specific-ID with HIFO on, say, BTC for the first sale of the year, you must use a consistent method for all subsequent BTC sales that year. You CAN use different methods on different assets (FIFO on BTC, HIFO on ETH) but NOT switch mid-year on the same asset. Audit flag if you do.
- Forgetting NIIT on long-term gains. Net Investment Income Tax (3.8%) hits long-term capital gains above $200K single / $250K MFJ modified AGI. Federal long rate of 15% becomes 18.8% effective; 20% becomes 23.8%. Bake into your ‘long rate’ input if you’re near or above the threshold. NIIT applies on top of state CG tax (CA 13.3%, NY 10.9%) — high earners in high-tax states can hit 35-37% combined long rate, which closes much of the short-vs-long spread.
- Treating staking rewards / airdrops as zero- basis lots. They’re NOT zero basis. Per Notice 2014-21 and Rev. Rul. 2019-24, staking / mining / airdrop rewards are taxed as ordinary income at FMV on the day received; that FMV becomes the basis for future capital-gains tracking. Enter them as lots with basis = FMV at receipt, not $0. Failing to do so double-taxes you (once at receipt, again at sale).
- Splitting a partial sale across lots without updating quantities. When you sell 0.5 BTC from a 1.5 BTC lot, the remaining lot becomes 1.0 BTC at the original basis. For your next sale, you have a 1.0 BTC lot, not the original 1.5. Aggregators handle this automatically; if you’re tracking manually, update the lot table after each sale so the remaining-quantity records stay accurate.
Related Calculators
For the loss-side counterpart, run the Tax-Loss Harvesting Calculator on any crypto positions sitting underwater. The lot optimizer minimizes tax on winning sales; the harvest calc maximizes tax savings on losers. Run both at year-end — sell HIFO to lock in low-tax wins, sell underwater positions for losses, and the combined waterfall offsets gains against losses before applying rates. Before electing your sale method, run the Tax Bracket Calculator with your full-year income including the planned crypto gain. If the gain pushes you into a higher long-term bracket (15% → 20%) or triggers NIIT (3.8% above the threshold), splitting the sale across two tax years may save more than the FIFO- vs-HIFO spread alone. Pair with the Investment ROI Calculator to compute post-tax return on the proceeds — this is the honest number for comparing crypto realized return against benchmark equities. And if you’re close to the 1-yr line on a lot, run the Compound Interest Calculator to see how holding 2-3 more months affects after- tax outcome — the rate-spread savings of waiting usually outweigh the price risk for retail amounts, but only if you have other liquidity to fund the immediate need.
Frequently Asked Questions
The most common questions we get about this calculator — each answer is kept under 60 words so you can scan.
Why does the lot accounting method matter so much?
Because the IRS lets you pick which specific lot of crypto you’re selling, and different lots have different cost bases. Selling a high-basis lot produces a small gain; selling a low-basis lot produces a large gain. On the same dollar of proceeds, the tax can swing 30-70% depending on which lot you assign. Method choice is the single highest-leverage tax lever in retail crypto trading — bigger than holding-period optimization for many portfolios because basis dispersion across lots is often wider than the short-vs-long rate spread.What’s the difference between FIFO, LIFO, and HIFO?
FIFO (first-in-first-out) sells your oldest coins first — IRS default fallback if you can’t identify the lot. Often produces large gains in long-running portfolios where early buys had low basis. LIFO (last-in-first-out) sells newest coins first — works when recent buys are at higher prices than older ones (typical for HODLers in a rising market post-DCA). HIFO (highest-in-first-out) sells whichever lots have the highest cost basis regardless of date — almost always the lowest tax outcome because it minimizes gain by maximizing basis used. The trade-off: HIFO requires you to consciously elect specific-ID and keep records; FIFO is automatic.Can I actually elect HIFO or LIFO on my taxes?
Yes, under IRS specific-identification rules — but you must satisfy the recordkeeping bar. IRS requires contemporaneous records identifying (a) the date and time of acquisition, (b) the quantity, (c) the cost basis, and (d) the sale-time identification of the specific lot being sold. Practically: most major US exchanges (Coinbase, Kraken, Gemini) support per-trade lot selection in their tax interfaces or via API. Aggregators like CoinTracker, Koinly, and TaxBit automate the bookkeeping if you connect your wallets. You cannot retroactively elect HIFO at year-end — you must identify the lot at the time of each sale. The IRS guidance is in Notice 2014-21 and Rev. Rul. 2019-24.Why doesn’t the calc let me offset losses against gains?
Because the rollup is per-sale, not per-tax-year. The calc shows the tax on this specific sale under each method. Real-world tax filing then aggregates short and long pools across the year: short-term losses offset short-term gains first, long-term losses offset long-term gains first, then any remainder cross-offsets, then up to $3K of net capital loss offsets ordinary income, then the rest carries forward. For a multi-sale year, run this calc on each sale, sum the gains by term, and apply the waterfall — or use a tax engine that does it automatically. The Tax-Loss Harvesting calculator covers the offset waterfall in detail.What if my lots all have similar cost basis?
Then method choice doesn’t matter much — the verdict will say so. Method matters when basis dispersion is wide (e.g., a $20K-basis lot from 2020 alongside an $85K-basis lot from 2024). When all lots cluster around the same basis (typical of recent DCA into a flat market), FIFO / LIFO / HIFO converge. Holding-period optimization (waiting for the 1-yr mark) becomes the bigger lever in that case. The calc auto-detects this and tells you specific-ID isn’t worth the bookkeeping if savings are under ~$50.Why does ‘months held’ matter beyond the 12-month threshold?
Two reasons. First, ≥12 months unlocks long-term capital-gains rates (0 / 15 / 20% federal + NIIT), which are dramatically lower than ordinary rates (22-37% federal). The 1-yr line is the single biggest tax lever in crypto. Second, months-held drives FIFO and LIFO ordering — FIFO sells the lot with the highest months held first; LIFO sells the lot with the lowest months held first. HIFO ignores months held and sorts purely by cost basis. The calc surfaces all three orderings so you see exactly which lots get sold under each method.How does this interact with wash-sale rules?
Wash-sale rules (IRC §1091) currently apply only to stocks and securities, NOT to crypto. As of 2024, you can sell crypto at a loss and rebuy immediately without disallowance — a meaningful tax-loss-harvesting advantage crypto has over equities. Congress has proposed extending §1091 to digital assets multiple times (Build Back Better, Lummis-Gillibrand framework); if enacted, the 30-day window will apply. The calc doesn’t flag wash sales because the rule doesn’t bind for crypto today; if it changes, run the Tax-Loss Harvesting calc which models the wash window for securities.Do exchange fees count in cost basis or proceeds?
Both, for the cleanest result. Buy-side fees are basis-additive — if you paid $100 to buy 1 BTC and $1 in exchange fee, your cost basis is $101. Sell-side fees reduce proceeds — if you sold 1 BTC for $200 and paid $1 in fee, your proceeds are $199. Most exchange tax exports already net these correctly. If you’re running this calc against pre-fee numbers, the tax will be slightly overstated; for major holdings the difference is sub-1%. For accuracy on large sales, use post-fee basis and post-fee current price.What about staking rewards, airdrops, mining, or hard forks?
Those are separate income events with their own basis. Staking / mining rewards are taxed as ordinary income at the FMV on the day received; that FMV becomes the basis for future capital-gains tracking. Airdrops and hard forks are taxed similarly per Rev. Rul. 2019-24. For the lot optimizer, treat each reward as a separate ‘purchase’ lot with basis = FMV at receipt and acquisition date = receipt date. The 1-yr clock starts at receipt, not at the underlying chain’s genesis. The calc handles them correctly as long as you enter them as discrete lots.Why does the proceeds figure stay the same across methods?
Because proceeds = sell quantity × current price — independent of which lots you assigned. The IRS doesn’t care which lot you say you sold for purposes of the proceeds line; the dollars hitting your account are the same. What method choice changes is the cost-basis line — which lots you assign, and therefore the basis subtracted from proceeds to compute gain. The math is gain = proceeds − basis, and tax = gain × rate. Since proceeds are fixed, method choice moves only the basis lever; that’s where the tax savings come from.Is this calc US-only or does it work for other countries?
The mechanics (FIFO / LIFO / HIFO) work everywhere; the tax-rate inputs are the country-specific layer. In the UK, HMRC requires the share-pooling method (weighted average basis) for crypto — specific-ID via FIFO / LIFO / HIFO isn’t allowed; this calc would not match a UK return. In Germany, crypto held over 1 year is fully tax-free at the individual level (Privatvermögen) — set long-term rate to 0%. In Australia, ATO allows specific-ID with a similar waterfall; enter your AU short / long rates. In Canada, FIFO is mandatory for inventory-style crypto trading; method choice doesn’t apply. Always verify against your jurisdiction’s rules before relying on the output.What records do I need to support specific-ID at audit?
Five things. Trade confirmation showing the lot ID at sale time (most exchange tax-tools generate this if you elected per-trade lot selection). Acquisition records showing date, quantity, basis, and origin (purchase / staking / airdrop / mining). A consistent method per asset across the tax year (you can use FIFO for BTC and HIFO for ETH, but not flip mid-year on the same asset). Form 8949 + Schedule D filed showing the lots sold under your elected method. Reconciliation between exchange records and your filed return. Aggregators (CoinTracker, Koinly, TaxBit) generate all of the above when wallets are connected; manual spreadsheet tracking works but is fragile. The IRS has been auditing crypto returns more aggressively since 2022 — keep records 7 years.