Chronological Lot Comparisons

Free Crypto Cost Basis Calculator

Compare FIFO, LIFO and HIFO for entered buy and sell transactions. See allocated costs and remaining lots. Optional historical closes are scenario inputs, not proof of your actual tax basis.

FIFO / LIFO / HIFO
Optional Closing-Price Scenarios
100% Free
Crypto transaction inputs
Popular:
buy#1

Enter one asset and one wallet or account at a time. Same-date rows are processed in the displayed order. A fetched close replaces that row price for a scenario; use actual execution records for your ledger. Fees and transfers are not modeled.

Price data sourced from FinancialModelingPrep. Historical prices are end-of-day closes, not trade executions. Quote availability varies; a fetched quote is not a streaming or executable price.

Compare allocation methods on the same transactions

Select a crypto symbol and enter each buy and sell with its date, quantity and USD price per unit. Use actual trade records where available. Transactions are sorted by date; equal-date transactions use their displayed row order. Enter those rows in execution order. A sale larger than the holdings available at that time stops the calculation.

FIFO, LIFO and HIFO

FIFO consumes the earliest available lot. LIFO consumes the latest available lot. HIFO consumes the highest-priced available lot. Each purchase remains a separate lot even when dates, prices and quantities are identical. The method changes cost allocation, not total cash paid or received.

For an illustrative buy of 1 unit at $30,000, a later buy of 1 unit at $50,000, then a sale of 1 unit at $45,000: FIFO realizes $15,000 and leaves $50,000 of cost. LIFO and HIFO realize −$5,000 and leave $30,000. At a reference price of $45,000, realized plus unrealized profit is $10,000 under each method, before costs. These are invented prices.

Read the quantities in the formulas

Sale proceeds = sold quantity × sale price per unit. Realized gain = sale proceeds − cost allocated to sold units. Remaining cost = sum of each remaining lot quantity × its purchase price. Average remaining cost = remaining cost / remaining quantity. Unrealized gain = remaining quantity × reference price − remaining cost. An average or percentage with no meaningful denominator is not a trading signal.

Tax records require more than a method selector

The IRS digital-assets guide calls for transaction records and basis information. Its current digital-asset FAQs explain transaction costs and rules applying from 2025. The controls here do not establish compliance with identification, broker or wallet requirements.

A daily closing quote is not evidence of the amount you paid or received. Fetching one overwrites the row's price for a scenario. This calculator omits fees, transfers, rewards, gifts, inherited assets and jurisdiction-specific adjustments. It does not choose a tax rate or file a return.

Keep the exported scope clear

Export CSV saves the remaining lot table. It does not export your complete transaction ledger or each sale's matched lots. Retain execution timestamps, quantities, fees, wallet or account identifiers and supporting records separately.

Frequently Asked Questions

What does this calculator compare?

It allocates entered purchase costs to sales using FIFO, LIFO or HIFO and shows remaining lots and modeled profit or loss. It does not determine whether a method is permitted for your tax situation.

How are lots matched?

Transactions run in date order; equal dates use displayed row order. FIFO uses the earliest available lot, LIFO the latest, and HIFO the highest-priced available lot. A future purchase cannot cover an earlier sale. Overselling produces an error.

Does HIFO guarantee the lowest tax?

No. It prioritizes a higher cost per unit among available lots, but actual tax also depends on eligibility, identification, holding periods, rates and other transactions. A comparison here is not a valid tax-lot election or broker instruction.

Can I substitute a historical close for my purchase price?

Only for a scenario. The optional fetch button fills the exact-date daily close when available. It does not establish your actual execution price, fees or basis. Edit the field to use your transaction record instead.

Does this include fees, transfers or multiple wallets?

No. Enter one asset and one wallet or account at a time. There is no transfer reconciliation, fee input, staking-income treatment, holding-period classification or exchange import.

Does dollar-cost averaging always lower average cost?

No. Regular purchases create separate lots, and a purchase above your current average raises it. The displayed average is the weighted cost of remaining lots after allocated sales.

What does the CSV contain?

The CSV lists remaining purchase lots and their modeled cost. It is not a disposal-by-disposal gain report, tax form or proof of specific identification. Keep original trade and wallet records separately.

Is the tool free and are quotes live?

The calculator is available without registration. Quotes are fetched on request through the data provider, not streamed; availability and freshness vary. Values do not include execution spreads or fees.

Research Trading Rules Alongside Your Ledger

Use Pineify to draft Pine Script indicators or backtest rules for TradingView. This cost-allocation tool does not connect a wallet, place trades or transfer tax records into a strategy.