FIFO vs LIFO vs HIFO: The Crypto Cost Basis Method Guide

Your crypto cost basis method sets your tax bill. See FIFO, LIFO and HIFO give three different gains on one sale, plus the 2025 rules that make it stick.

Three crypto purchase lots at different prices feeding into one sale, showing how FIFO, LIFO and HIFO cost basis methods each produce a different taxable gain from the same disposal

Crypto tax season is a nightmare for one specific reason, and it is not the concept. The concept fits on an index card: you owe tax on the gain when you dispose of a coin, and the gain is what you sold it for minus what you paid. The nightmare is that "what you paid" is not one number. If you bought the same coin ten times at ten prices, the tax code lets you choose which of those purchases you are selling, and the choice can swing your bill by thousands of dollars on the exact same trade.

That choice has a name: your crypto cost basis method. Get it right and you keep more of your own money legally. Get it wrong, or leave it on autopilot, and you either overpay or hand yourself an audit risk you did not need. Most traders never think about it until they are staring at 4,000 trades across three exchanges in April, trying to hand their accountant a clean export and discovering the numbers do not agree.

This is a guide to the three method labels you will see everywhere, FIFO, LIFO, and HIFO, what the IRS actually permits after the 2025 rule changes, and why the whole exercise depends less on which method you pick than on whether your records can defend it. TradeArmor is a self-hosted trading platform, and its DCA, grid, futures, signals, backtesting, and tax-export tools all sit downstream of one thing: a complete, local trade log. That log is what makes any of this tractable, so it is worth understanding what the methods do before you trust software to apply one.

The one example that explains all three methods

Forget the definitions for a second and watch the money move. Say you bought Bitcoin in three lots this year:

  • January: 0.1 BTC at $40,000, so a $4,000 cost basis
  • March: 0.1 BTC at $60,000, so a $6,000 cost basis
  • June: 0.1 BTC at $50,000, so a $5,000 cost basis

In September you sell 0.1 BTC for $7,000. You still hold the other two lots. The proceeds are fixed at $7,000. The only variable is which lot the tax code treats as the one you sold.

  • FIFO sells the January lot first. Gain: $7,000 minus $4,000, which is $3,000.
  • LIFO sells the June lot first. Gain: $7,000 minus $5,000, which is $2,000.
  • HIFO sells the March lot first. Gain: $7,000 minus $6,000, which is $1,000.

Same coin, same sale, same day, and the reportable gain ranges from $1,000 to $3,000 depending purely on the label. That is the entire reason cost basis method matters, and it is why the industry spends so much energy arguing about it.

There is a catch the example hides, and it is the one that trips people. The January lot FIFO wants to sell is also your oldest, which means it is closest to qualifying for the long-term capital gains rate. HIFO's smaller $1,000 gain might be short-term and taxed as ordinary income, while FIFO's larger $3,000 gain could be long-term and taxed lower. A smaller number at a higher rate can cost more than a bigger number at a lower one. The method that minimizes your gain on paper is not automatically the method that minimizes your tax.

FIFO: the default you fall back into

FIFO, first in first out, assumes the earliest coin you bought is the first one sold. It is the IRS default for digital assets and the method you land on if you do nothing at all. It is also the easiest to defend, because "we sold the oldest lot" requires no special election or contemporaneous paperwork. You just need to know the order you bought in.

In a market that has trended up over a long horizon, FIFO tends to produce larger gains now, because your oldest lots usually have the lowest basis. The upside is that those same old lots are the ones most likely to clear the one-year mark and qualify for long-term treatment. FIFO is the method that requires the least explaining, which is worth something the day a letter arrives.

HIFO and LIFO are not methods, they are lot selection

Here is the nuance that most three-year-old blog posts get wrong. LIFO and HIFO are not separate, IRS-recognized crypto cost basis methods. Since January 1, 2025, the only two accepted approaches for digital assets are FIFO and specific identification. HIFO, highest in first out, and LIFO, last in first out, are lot-selection orders you reach through specific identification. They are outcomes, not blessed methods.

That distinction has teeth. The IRS only honors specific identification if you identify the exact units being sold at or before the moment of the disposal. You cannot decide in December that all your September sales were HIFO. The standard way to run it is a standing instruction: a written directive kept in your books and records, or configured in your tax software before the trade, that tells the system which lots to select and in what order. Set it up front and the method holds. Reverse-engineer it after the fact and you get FIFO with extra steps, no matter what the export says at the top.

Want to see how the trade log, the strategy engine, and the tax exports fit together before next April? See all features.

The 2025 rules that quietly reshuffled everyone's basis

Two changes landed recently and caught a lot of traders flat-footed, because the mechanics of crypto tax reporting changed underneath them.

The first is the wallet-by-wallet rule. As of January 1, 2025, the final regulations at Treasury Regulation 1.1012-1(j) require you to track basis on a wallet-by-wallet and account-by-account basis. The old universal method, where you pooled every unit of a coin across every exchange and wallet into a single running basis, is gone. Revenue Procedure 2024-28 offered a one-time safe harbor to allocate unused basis to specific wallets as of the start of 2025, with a deadline tied to your first 2025 disposal. If you never made that allocation, your software made an assumption for you, and you should know what it was.

The second is broker relief. IRS Notice 2025-7 gave temporary relief for 2025 transactions, letting you satisfy the specific-identification requirement by recording your standing instruction in your own books and records without having to notify the exchange first. That relief is a lifeline, and it is also a reminder: the burden of proof for HIFO or LIFO sits on your records, not the exchange's. The exchange knows what you sold. Only you know which lot you meant.

Overlay the new Form 1099-DA and the picture sharpens. Custodial brokers must report your gross proceeds for 2025 sales, but basis reporting is voluntary in the transition year and mandatory only for transactions on or after January 1, 2026. So the IRS receives a form showing what you sold for, with no record of what you paid, until you supply it. A form that reports proceeds but not basis is a form that makes every sale look like pure profit. Your own lot-level records are the only thing that corrects it.

Your crypto cost basis method is only as good as the log

You can pick the perfect crypto cost basis method and still lose the argument if your data cannot back it. This is where most tax pain actually originates, and it has nothing to do with accounting cleverness.

Specific identification demands lot-level records: every acquisition with its date, price, fee, and the wallet it lives in. Exchange CSVs were not built for that. They ship in mismatched formats, log internal transfers as disposals, drop fees into inconsistent columns, and sometimes lose delisted tokens entirely. When people say an aggregator "chokes on the CSVs," the tool is fine. The input was broken before it arrived. Garbage in, audit risk out.

A self-hosted trading bot sidesteps the reconstruction problem by never creating it. TradeArmor sees every fill at the instant it happens, with price, size, fee, and timestamp, because it placed the order. A DCA strategy running many levels across a few pairs can generate hundreds of small lots a year, each with its own basis and date, which is exactly the situation where FIFO, LIFO, and HIFO diverge the most and exactly the situation exchange CSVs handle the worst. Because the log lives in a local database on your own machine rather than a vendor's cloud, every trade across every connected venue, whether you run on Binance US, Bybit, or any supported exchange, lands in one consistent record. At tax time you export it under FIFO, LIFO, or HIFO, to a Koinly CSV, a CoinTracker CSV, or raw JSON, and hand a professional one clean file instead of a shoebox of screenshots.

It also keeps your data where it belongs. A SaaS tax integration wants read access to your exchange account on its servers. A self-hosted bot already holds the data locally and never phones your full financial history anywhere. The bot does not do your taxes, and it should not. It hands your tax software, or your CPA, a record clean enough that choosing and defending a method is the easy part again. The judgment stays with the human qualified to make it.

The short version

Your crypto cost basis method decides which lot you sold, and that decision can triple or third the gain on a single trade. FIFO is the default and the simplest to defend. HIFO and LIFO can lower your near-term gain, but only if you elect specific identification before the sale and keep records that prove it, and only after you have weighed the holding-period trade-off. All of it rests on a complete, lot-level trade log, wallet by wallet, captured as the trades happen. Build the record right and the method is a setting. Build it wrong and no method will save you.

Run your automation on your own hardware, keep your keys and your trade history local, and give tax season one clean export instead of a reconstruction project. See pricing and get started.

This article is educational and is not tax or investment advice. Cost basis rules are complex and depend on your jurisdiction and circumstances. Consult a qualified tax professional before choosing or changing a method.