← Blog

How to Calculate Your Crypto Cost Basis (Step-by-Step)

Last updated July 12, 2026

Your cost basis is the foundation of every profit and loss calculation you will ever make as a crypto trader. Get it wrong, and every number downstream, including your realized gains, your tax bill, and your actual performance, is built on sand.

What Is Cost Basis and Why Does It Matter?

Cost basis is the total amount you paid to acquire a crypto asset, including the purchase price plus any transaction fees. When you sell or trade that asset, your realized gain or loss is simply the sale price minus the cost basis. A higher cost basis means a smaller taxable gain. An incorrect cost basis means you could overpay taxes or misread how your strategy is actually performing.

Step 1 - Record Every Purchase with Four Key Data Points

Before choosing a calculation method, you need clean records. For every buy, note the date of acquisition, the quantity purchased, the price per coin at the time of purchase, and any fees paid (exchange fees, gas fees, network fees). Fees are added to the cost basis, so a purchase of one ETH at a listed price of 2,000 dollars with a 10 dollar fee gives you a cost basis of 2,010 dollars, not 2,000 dollars. Skipping fees is one of the most common and costly record-keeping mistakes.

Step 2 - Choose a Cost Basis Accounting Method

There are four main methods used by crypto traders. Each produces a different cost basis number from the same set of purchases, which means each produces a different realized gain or loss on the same sale.

  • FIFO (First In, First Out): The oldest coins you bought are treated as the first ones sold. Simple, widely accepted, and the default in many jurisdictions.
  • LIFO (Last In, First Out): The most recently purchased coins are sold first. Can reduce gains in a falling market but is not permitted in all tax regimes.
  • HIFO (Highest In, First Out): The coins with the highest purchase price are sold first, minimizing the taxable gain on each sale. Useful in bull markets but requires detailed lot tracking.
  • Specific Identification (SpecID): You manually choose exactly which lot of coins you are selling. Maximum flexibility, but demands precise records for every individual lot.

Step 3 - Apply the Method with a Worked Example

Suppose you bought Bitcoin in three separate lots: Lot A was 0.5 BTC at 30,000 dollars each (total cost 15,000 dollars). Lot B was 0.5 BTC at 40,000 dollars each (total cost 20,000 dollars). Lot C was 0.5 BTC at 50,000 dollars each (total cost 25,000 dollars). You then sell 0.5 BTC at 55,000 dollars. Under FIFO, you are selling Lot A, so your gain is 55,000 minus 30,000, which equals 25,000 dollars. Under HIFO, you are selling Lot C, so your gain is 55,000 minus 50,000, which equals 5,000 dollars. Same trade, same sale price, dramatically different taxable outcome depending solely on which method you apply consistently.

Step 4 - Handle Average Cost Basis (for Frequent Buyers)

If you dollar-cost average into a position and do not want to track individual lots, you can use a weighted average cost basis. Add up the total amount spent across all purchases, then divide by the total quantity held. Using the example above: total spent is 60,000 dollars across 1.5 BTC, giving an average cost of 40,000 dollars per BTC. When you sell 0.5 BTC at 55,000 dollars, your gain is 55,000 minus 40,000, which equals 15,000 dollars. This method is straightforward but less flexible than lot-specific approaches when it comes to tax optimization.

Step 5 - Account for Swaps, Conversions, and Fees

Trading one cryptocurrency directly for another (for example, swapping ETH for SOL on an exchange) is treated as a disposal of ETH and an acquisition of SOL in most tax frameworks. The cost basis of your new SOL position is its fair market value at the time of the swap. You must also record the gain or loss on the ETH you gave up. Ignoring crypto-to-crypto trades is one of the most frequent errors traders make. Every swap creates two taxable events in one transaction.

Step 6 - Track Each Lot Separately as You Add to a Position

Each time you buy into a position (averaging down, adding on a breakout, or scaling in), you create a new cost basis lot with its own acquisition date and price. If you use FIFO or HIFO, those lots must stay separate in your records. Commingling them into a single average the moment you add destroys the precision you need. A trade journal or P&L tracker that records each entry as a distinct lot makes this step automatic. CryptaDash logs every position entry as its own lot, so your realized and unrealized P&L figures always reflect the actual cost basis method you have chosen rather than a blended guess.

Common Pitfalls That Corrupt Your Cost Basis

  • Forgetting to include exchange fees and gas fees in the purchase price.
  • Treating wallet-to-wallet transfers as sales and resetting basis incorrectly.
  • Mixing two different accounting methods across the same tax year.
  • Failing to record the fair market value of crypto received as staking rewards or airdrops at the time of receipt.
  • Using rounded or estimated prices instead of the actual execution price from your exchange history.

Frequently asked questions

What is cost basis in crypto?

Cost basis is the original price you paid for a crypto asset, including any fees. It is used to calculate your realized gain or loss when you sell or trade that asset.

Which cost basis method is best for crypto?

There is no single best method. FIFO is the most widely accepted and simplest to apply. HIFO can reduce taxable gains in rising markets. The right choice depends on your trading style and tax situation.

Does cost basis reset when I transfer crypto between wallets?

No. Transferring crypto between your own wallets does not trigger a taxable event, and the original cost basis carries over to the destination wallet.

What happens to my cost basis if I receive crypto as a reward or airdrop?

Crypto received as staking rewards or airdrops typically takes on the fair market value at the time of receipt as its cost basis. Each reward lot has its own basis and acquisition date.

Why does my cost basis matter if I am not selling right now?

Knowing your current cost basis lets you calculate unrealized P&L accurately, plan exits strategically, and avoid surprise tax bills when you do decide to sell.

The market doesn't take your money - your habits do

Most accounts don't die on bad setups. They die on FOMO, revenge trades, and never tracking what actually works. CryptaDash makes the discipline automatic.

  • Avoid revenge trading - a hard cool-off locks you out after a loss.
  • Avoid the round-trip - lock your daily target and stop while you're green.
  • Avoid flying blind - see your real win rate, R-multiple and P&L per coin.
Start free - keep your disciplineFree to start · read-only exchange sync · no card