How to Calculate Cost Basis for Crypto

Last Updated on November 12, 2026 by Patrick Camuso, CPA

Quick Answer

The formula for how to calculate cost basis for crypto: Cost basis = purchase price + capitalized transaction fees, assigned to a specific tax lot at the time of acquisition.

What changes the calculation: How the asset was acquired, whether bought, earned, or received, determines what number goes into basis and when.

What method matters: Specific identification is the identification mechanism. FIFO applies when the taxpayer does not make an adequate and timely identification. HIFO and LIFO are lot-ordering conventions. They work only through a valid specific identification.

What breaks in practice: Transfers misclassified as sales, income events with undocumented valuations, and missing acquisition history all produce a calculated basis that does not match actual defensible basis.

The Basic Calculation

This guide covers the calculation mechanics for investors, traders, and Web3 participants who need to calculate and substantiate crypto cost basis across exchanges, wallets, and DeFi activity.

Cost basis for a purchased digital asset is the total amount paid to acquire it, including any transaction fees that are capitalized rather than deducted as expenses.

The formula:

Cost basis = purchase price + capitalized transaction fees

A taxpayer who paid $10,000 for one Bitcoin and paid a $50 exchange fee on that transaction has a cost basis of $10,050 for that lot. The acquisition date is the trade date. The holding period begins the day after acquisition. That lot, one Bitcoin at $10,050 basis with its specific acquisition date, carries forward in the inventory until disposal. On sale, the gain or loss is the amount realized minus that $10,050.

Every transaction fee associated with an acquisition should be capitalized into the basis of the asset acquired. The IRS uses the term “digital asset transaction costs” to refer to amounts paid for services provided by another to effect the purchase, sale, or disposition of a digital asset. These include transaction fees, gas fees, transfer taxes, and commissions. Fees paid on disposals reduce the amount realized rather than increasing basis, but the practical effect on taxable gain is the same.

One important exclusion, amounts paid for transaction services to effect a transfer of digital assets between the taxpayer’s own wallets or accounts are not digital asset transaction costs and are not capitalized into basis. Those fees do not increase the basis of the transferred asset.

How to Calculate Cost Basis by Acquisition Type

The formula changes depending on how the asset was acquired.

Purchased on an Exchange

Basis equals the purchase price plus any capitalized fees. For exchange purchases, the fee is typically displayed as a separate line item in the transaction detail. Both the purchase amount and the fee should be pulled from the exchange record, not reconstructed from memory.

If partial fills are involved and an order executes across multiple fills at slightly different prices, the basis is the weighted average execution price across all fills for that order, plus fees. The underlying lot derives from the actual execution record and broker confirmation, not an after-the-fact estimate.

Received as Compensation

Staking validation rewards and mining rewards generally establish basis by reference to the amount included in income under the rules applicable to the receipt. Compensatory token grants may be governed by §83, including vesting and substantial-risk-of-forfeiture rules. Liquidity-mining and protocol distributions require analysis of the specific arrangement before income timing and basis are determined. Where digital assets are received by an independent contractor for performing services, the amount included in income can also be self-employment income.

The calculation:

Where mining income or the IRS’s stated staking position applies, basis equals the fair market value included in income. Token grants and liquidity distributions are not assumed to follow that formula.

Fair market value is typically the spot price on a recognized exchange at the time the asset was credited to the taxpayer’s wallet or account. The specific timestamp matters. For assets with significant intraday volatility, the difference between a price pulled at midnight versus the actual receipt time can be material. The applicable timing depends on the specific facts, which can differ across protocol staking, validator staking, and exchange staking arrangements.

For thinly traded tokens without deep exchange markets, fair market value may require a more considered analysis of available pricing data. The valuation methodology should be documented and applied consistently.

Received Through Hard Forks and Airdrops

Under the IRS’s published position, when a taxpayer receives units following a hard fork via an airdrop and has dominion and control over those units, ordinary income is recognized at the fair market value of the assets received, and that recognized amount becomes the basis. The income recognition and basis establishment framework follows the same structure as other compensation-type receipts.

Edge cases exist around the factual timing of access and when dominion and control is actually established, particularly where a taxpayer lacks immediate access to the new units or where the assets are not yet tradeable. Those fact-specific questions affect the timing of income recognition and therefore the timing of basis establishment. The basic framework, that dominion and control triggers income and recognized income becomes basis, is the IRS’s stated position and should be the starting point for any hard fork or airdrop analysis.

Acquired Through DeFi Protocol Interactions

Liquidity pool deposits, wrapped token conversions, bridge transactions, and protocol-level exchanges each require classification before basis can be calculated.

If the event is treated as a taxable disposal, the asset disposed of has a recognized gain or loss, and the new asset received establishes basis at its fair market value at the time of receipt. If the event is treated as a nontaxable transfer, the original basis carries through to the new asset. The classification controls the calculation.

The treatment of transaction fees in a crypto-for-crypto exchange follows a specific rule that differs from a standard cash purchase. When digital assets are exchanged for other digital assets in a taxable transaction, the fees paid to effect that exchange are allocable to the disposed asset side. They reduce the amount realized on the asset given up and cannot be added to the basis of the asset received. This is the opposite of how acquisition fees work in a cash purchase, where fees are capitalized into the basis of the asset acquired. The distinction matters for any DeFi swap, token exchange, or conversion that is treated as a taxable disposal.

This is one of the primary areas where different software platforms diverge. The same DeFi interaction can produce different basis outcomes depending on whether the platform treats it as a taxable exchange or a nontaxable transfer.

Inherited Crypto

The basis of inherited digital assets is generally determined under §1014. It is the fair market value on the date of the decedent’s death, or on the alternate valuation date if that election applies. That value can be higher or lower than the decedent’s basis. Inherited basis is not universally a step-up.

Gifted Crypto

Gift basis uses the dual-basis rules. If the fair market value at the gift is at least the donor’s basis, the recipient generally takes the donor’s basis. If the fair market value is less than the donor’s basis, the recipient uses the donor’s basis to measure later gain and the gift-date value to measure later loss. A sale for an amount between those two figures produces neither gain nor loss. The donor’s holding period carries over when the recipient uses the donor’s basis.

Those rules depend on being able to substantiate the donor’s basis. Where that basis cannot be established from the records, the recipient has to determine what the available evidence supports. Missing donor records do not by themselves establish zero basis.

How the Calculation Works on Disposal

On disposal of a digital asset, the gain or loss calculation requires two numbers, the amount realized and the adjusted basis of the lots relieved.

Amount realized = proceeds minus any selling fees

Gain or loss = amount realized minus adjusted basis of lots relieved

Holding period = from the day after acquisition of the specific lots relieved to the date of disposal

The holding period governs whether gain is short-term (held one year or less) or long-term (held more than one year), which determines the applicable tax rate.

How the Method Affects the Calculation

Which lots are relieved on disposal, and therefore what basis is subtracted, depends on the accounting method applied.

For digital assets subject to the specific-identification rules, specific identification is the identification mechanism. FIFO generally determines the units disposed of when the taxpayer does not make an adequate and timely identification. The identification is made within the wallet or account where the units are held.

Specific identification: The taxpayer identifies the particular units disposed of, in time, and with records sufficient to establish their basis and holding period. HIFO, LIFO, and other lot-ordering conventions are not separate methods. They produce the intended order only when implemented through that identification.

FIFO: FIFO applies when adequate identification is absent. It treats the earliest-acquired units in the relevant wallet or account as disposed of first.

Through December 31, 2026, Notice 2026-20 extends the temporary relief first provided by Notice 2025-7. During that period, an eligible taxpayer can make certain adequate identifications for broker-held digital assets in the taxpayer’s own books and records without communicating the identification to the broker. The relief does not change the broker’s Form 1099-DA reporting. Under current guidance, transactions after December 31, 2026 follow the permanent adequate-identification rules unless the IRS issues additional relief. The relief does not apply to units held outside a broker.

Revenue Procedure 2024-28 was a transition safe harbor for allocating unused basis into wallet- or account-level tracking as of January 1, 2025. A taxpayer who did not satisfy the safe harbor cannot rely on the safe harbor. Missing the safe harbor does not by itself destroy basis. For a full breakdown of method selection and the Rev. Proc. 2024-28 transition, see our guide to choosing the right crypto cost basis method.

What Has to Be Tracked to Calculate Correctly

An accurate cost basis calculation depends on having the right inputs. Those inputs come from complete, reconciled records.

For each acquisition:

  • Asset and quantity acquired
  • Date and time of acquisition
  • Purchase price or fair market value at receipt
  • Transaction fees paid at acquisition
  • Source (exchange record, on-chain transaction, income documentation)

For each transfer between wallets or accounts:

  • The transfer must be matched to its origin and destination
  • A wallet-to-wallet transfer is not a taxable event and does not create a new lot
  • Unmatched transfers are the most common source of basis calculation errors: a withdrawal treated as a sale creates phantom gain, and an unmatched deposit treated as a new acquisition with zero basis understates the true cost

For each disposition:

  • The specific lot or lots being relieved (required for specific identification; implied by FIFO)
  • Date and time of disposal
  • Amount realized
  • Transaction fees at disposal

If any of these inputs are missing, estimated, or incorrectly classified, the calculation produces a result that does not reflect actual basis, regardless of how precisely the formula is applied.

Where Calculations Break Down in Practice

The formula is simple. The data is not.

Missing acquisition history is the most common failure point. If an exchange has no record of an acquisition, because the asset was purchased years ago, the exchange closed, or the CSV export was incomplete, the software assigns zero basis or omits the lot entirely. The calculation proceeds, but the basis figure is wrong.

Undocumented income events create the same problem. Staking rewards and airdropped tokens that were never recognized as income have no documented basis. When those assets are later sold, the gain is calculated from zero rather than from the correct fair market value at receipt.

Misclassified transfers distort the inventory. When a wallet-to-wallet movement is treated as a sale, the software records phantom gain, removes the lot from inventory, and creates a new lot at the deposit address with no acquisition history. The subsequent sale of that asset calculates against zero basis because the original lot is no longer in the inventory where it should be.

Valuation gaps affect income-type acquisitions. If fair market value at receipt was not documented at the time and is reconstructed later, the basis figure depends on the accuracy of the reconstruction and the pricing source used. Inconsistent or undocumented valuation methodology creates basis figures that cannot be verified.

These failures are not always visible from the gain and loss report. They are visible at the lot level. A defensible position requires that each disposition can be traced to a specific acquisition lot with documented basis and continuity across transfers. This risk is most acute in self-custody environments, where no third-party reporting exists to anchor the taxpayer’s position.

Differences in transaction timing conventions across platforms can also create reconciliation mismatches even where the underlying calculation is correct.

Calculated Basis vs Defensible Basis

Software can calculate a number from whatever data it has. That number is not a defensible tax position.

Calculated basis is the output of a software platform applied to the data it received, including incomplete imports, default assumptions for missing history, and unverified transfer matches. The platform produces a gain figure. That figure may or may not reflect what actually happened.

Defensible basis requires source documentation for every acquisition including exchange records, on-chain transactions, and income documentation. It requires matched and reconciled transfers so that every movement between wallets is verified and lots are not misclassified as sales. It requires documented valuations, with fair market value at receipt supported by a consistent and verifiable methodology. And it requires lot-level traceability, meaning every disposition traceable back to a specific acquisition lot with continuity across the full history.

As IRS matching systems compare broker-reported proceeds to taxpayer-reported gain, unsupported basis will surface as discrepancies. A calculated basis that cannot be traced back to evidence is a number. It is not a tax position that can be defended.

For a deeper look at how these errors embed and compound over time, see our article on crypto cost basis issues and why they break down.

Broker Reporting and Noncovered Assets

Even with a Form 1099-DA from a broker, taxpayers still need their own lot-level records.

Gross-proceeds reporting began with 2025 transactions. For 2026 sales, brokers must report basis for covered digital assets, while basis reporting for noncovered digital assets remains voluntary.

A digital asset transferred into a broker is generally noncovered for basis reporting. The broker may be unable to report basis for that asset. The taxpayer’s basis does not become zero because the broker did not report it. The taxpayer still has to substantiate the basis used on the return.

The compliance picture is further complicated by the existence of three independent records that describe the same economic activity but were never designed to reconcile with each other which are the on-chain transaction record, the output of whatever software or accounting method the taxpayer uses to calculate gains and income, and what the broker reports to the IRS on Form 1099-DA. Each reflects different data, different timestamps, different classification logic, and different scope. A 1099-DA reconciliation is not a plug-and-play exercise. It is the process of aligning all three records, resolving discrepancies, and ensuring that the return reflects the correct substantiated position. The taxpayer’s own lot-level records are the only layer that bridges all three.

A 1099-DA tells the IRS what was received from a sale. It does not tell the IRS what was paid. If the taxpayer’s records cannot supply a defensible basis for every lot disposed of, the IRS sees proceeds with no corresponding cost. The obligation to calculate and substantiate basis remains with the taxpayer regardless of what the broker does or does not report.

When Calculation Requires Reconstruction

If records are complete and reconciled, cost basis calculation is a mechanical process. If records have gaps, missing exchange history, untracked wallet activity, or unreconciled transfers, calculation shifts to reconstruction.

Reconstruction means working through the available evidence in priority order with exchange records and on-chain data first, then secondary sources such as email confirmations and bank funding records, then any contemporaneous taxpayer documentation. Where gaps remain after exhausting available sources, conservative assumptions are applied and documented in a formal assumptions register.

The output of a defensible reconstruction is a lot-level inventory schedule that can be traced back to documented evidence for every lot, not a software-generated gain summary that cannot explain where the basis figures came from. If records are incomplete, calculation alone will not produce a defensible result. At that point, the process shifts from calculation to reconstruction.

Most common cost basis mistakes:

  • Treating wallet-to-wallet transfers as taxable sales, which creates phantom gain and breaks the lot chain
  • Missing staking and airdrop income, leaving those lots with zero or unsupported basis
  • Applying HIFO or other specific identification strategies without contemporaneous lot documentation, which defaults the position to FIFO
  • Losing acquisition history through exchange closures, incomplete exports, or untracked self-custody, which can require reconstruction from the records that remain. That is Camuso’s methodology, not a formally named IRS standard

For investors whose transaction history spans multiple years, multiple platforms, or includes DeFi and self-custody activity that was never reconciled, calculation alone is not sufficient. Our crypto cost basis reconstruction services are built for exactly this scenario. Work with a crypto CPA established in this market since 2016.

Contact us to discuss your situation

Frequently Asked Questions

How do I calculate cost basis for crypto I bought at different prices?

Each purchase establishes a separate tax lot with its own basis and acquisition date. The prices are not averaged together unless an averaging method is being applied, which is not a permitted method for digital assets under current IRS guidance. Each lot keeps its specific purchase price plus fees. On sale, the units relieved are the units adequately identified. If adequate identification is absent, FIFO applies to the units in that wallet or account.

Does the transaction fee get added to cost basis?

Yes, when the fee is paid at acquisition. Transaction fees paid to acquire a digital asset are capitalized into the basis of the asset acquired. A $10,000 purchase with a $50 fee produces a $10,050 basis. Fees paid at the time of disposal reduce the amount realized rather than increasing basis, but the net effect on gain is the same. Fees paid to transfer assets between the taxpayer’s own wallets are not digital asset transaction costs under current IRS guidance and do not affect the basis of the transferred asset.

How do I calculate cost basis for crypto received as staking rewards?

Staking rewards establish basis at fair market value when the taxpayer gains dominion and control over the assets, in most cases when the rewards are credited to the wallet or account. That same value is recognized as ordinary income at that time. The basis equals the amount recognized as income. If the staking reward was 0.1 ETH and the fair market value when it was credited was $200, the basis of that lot is $200 and $200 of ordinary income was recognized at that time. The precise timing of dominion and control can vary depending on whether staking occurs directly on-chain, through a validator, or through an exchange.

What happens to cost basis when I transfer crypto between my own wallets?

A transfer between wallets under the same taxpayer’s control is not a taxable event and does not change the basis. The original tax lot, with its original basis and acquisition date, moves to the new wallet. The transfer must be properly recorded so the lot is not misclassified as a sale or treated as a new acquisition at zero cost. Fees paid to effect the transfer are not digital asset transaction costs under current IRS guidance and do not affect the basis of the transferred asset.

How does FIFO affect my cost basis calculation?

Under FIFO, the earliest-acquired lots are treated as disposed of first. On sale, the gain is calculated using the basis of the oldest lots. In a portfolio where early acquisitions have lower basis than recent ones, FIFO typically produces larger recognized gains. FIFO applies when adequate identification is absent. A highest-basis or other lot order requires a valid specific identification. Through December 31, 2026, Notice 2026-20 lets an eligible taxpayer make certain identifications for broker-held units in the taxpayer’s own books and records.

Can I use average cost basis for crypto?

No. Average cost basis is not a permitted method for digital assets under current IRS guidance. Specific identification is the identification mechanism, applied within the relevant wallet or account. FIFO applies when adequate identification is absent. Using an average cost approach on a crypto tax return is not a defensible position.

How are transaction fees treated when I swap one crypto for another?

In a crypto-for-crypto exchange treated as a taxable disposal, the fees paid to effect the swap are allocable to the asset being given up. They reduce the amount realized on the disposed asset and cannot be added to the basis of the asset received. This differs from a cash purchase, where acquisition fees are capitalized into the basis of the asset acquired. The practical consequence is that in a taxable swap, fees reduce the gain on the disposed side rather than increasing the basis of what was received. Fees paid to transfer assets between the taxpayer’s own wallets are not digital asset transaction costs and do not affect basis.

Related case study: Cost basis reconstruction case study.

About the Author
Patrick Camuso, CPA

Patrick Camuso, CPA

Founder and Managing Director, Camuso CPA  ·  Host, The Financial Frontier

Forbes Best-In-State Top CPA 2025 Forbes Best-In-State Top CPA 2026 AICPA Digital Asset Tax Task Force Tax Notes Federal & Global Author Forbes Business Council First U.S. CPA Firm to Accept Crypto Crypto-Native Since 2016

Patrick Camuso, CPA, Founder and Managing Director of Camuso CPA, has advised Bitcoin investors since 2016. The firm is a national digital asset and emerging-markets specialty practice with a select private-client practice. He serves on the AICPA Digital Asset Tax Task Force and has published in Tax Notes Federal and Tax Notes Global on digital asset taxation and prediction market tax classification, alongside a former head of the IRS Office of Digital Assets. He is the author of The Crypto Tax Handbook and the first published book on Web3 sales tax compliance, has taught CPE courses with leading providers on Form 1099-DA and other digital asset tax topics, hosts The Financial Frontier podcast, publishes The Digital Asset Digest newsletter, speaks at ETHDenver and other major conferences, and is a member of the Forbes Business Council.

Media Coverage: Bloomberg Tax  ·  Business Insider  ·  Accounting Today  ·  MarketWatch  ·  Morningstar  ·  Wired  ·  Yahoo Finance  ·  Forbes

Analysis published here has been cited in Tax Notes and referenced across major tax and financial publications.

Important Disclaimer

This article is provided by Camuso CPA for general informational purposes and does not constitute legal, tax, accounting, or investment advice. Tax laws and regulations are evolving rapidly and the information presented may not reflect current guidance. Reading this article does not create a CPA-client relationship. For advice on your specific situation, schedule a consultation with Camuso CPA.

Camuso CPA, PLLC

Floating