Skip to main content
DigiCalcs

How to Calculate Bitcoin Cost Basis

What is Bitcoin Cost Basis?

The Bitcoin Cost Basis Calculator tracks the adjusted cost basis of Bitcoin holdings across multiple purchases using FIFO (First In First Out), LIFO (Last In First Out), or HIFO (Highest In First Out) accounting methods to determine capital gains or losses on sales.

Formula

Capital Gain = Sale Price - Cost Basis (per selected accounting method)
SP
Sale Price ($) — Price at which Bitcoin was sold
CB
Cost Basis ($) — Purchase price of the specific lot being sold, including fees
HP
Holding Period (days) — Days between purchase and sale (>365 = long-term)
CG
Capital Gain ($) — Profit or loss on the sale (Sale Price - Cost Basis)

Step-by-Step Guide

  1. 1Enter all Bitcoin purchase transactions with date, amount, and price paid
  2. 2Enter the sale transaction details (date, amount sold, price received)
  3. 3Select the accounting method: FIFO (oldest lots first), LIFO (newest first), or HIFO (highest cost first)
  4. 4The calculator matches sold BTC to specific purchase lots and computes gain/loss per lot

Worked Examples

Input
Bought 1 BTC at $20K (Jan 2023), 1 BTC at $40K (Jan 2024). Sell 1 BTC at $65K
Result
FIFO: gain = $65K - $20K = $45K (long-term). LIFO: gain = $65K - $40K = $25K (short-term). HIFO: gain = $65K - $40K = $25K

Common Mistakes to Avoid

  • Not tracking every purchase lot separately — each buy creates a new tax lot with its own basis
  • Mixing accounting methods within the same tax year without consistency
  • Forgetting to include exchange fees and gas costs in the cost basis (they increase basis, reducing gains)

Frequently Asked Questions

Which cost basis method saves the most on taxes?

HIFO (Highest In First Out) typically minimizes current-year taxes by selling the highest-cost lots first, resulting in the smallest capital gain. However, this defers taxes to future years when you sell the lower-cost lots.

Can I switch cost basis methods?

The IRS requires consistency within a tax year for the same asset. You can use different methods for different assets (e.g., FIFO for BTC, HIFO for ETH). Specific identification is the most flexible — consult a tax professional.

Do exchange fees count toward cost basis?

Yes — purchase fees (exchange fees, network fees) increase your cost basis, and selling fees reduce your net proceeds. Both reduce your taxable gain. Always track fees as part of each transaction.

Ready to calculate? Try the free Bitcoin Cost Basis Calculator

Try it yourself →

Settings

PrivacyTermsAbout© 2026 DigiCalcs