Skip to main content

Bitcoin cost basis calculator

Your cost basis is what you paid for the bitcoin you hold. Average it across a DCA plan and it answers “what is my real buy price?” Split it back out into individual purchases and it becomes the thing every tax authority actually cares about. This page does both. First a worked example on real prices, then a tracker you can put your own positions into.

Your positions are stored in this browser's local storage, and every figure is calculated on your device. There is no account and no database. One honest caveat. To price buys that fall outside the window this page loads, the tracker asks our server for prices covering the date range your positions span. Those dates do leave your browser. The amounts, labels and results never do.

Average cost basis, precisely

Average cost basis is total fiat spent divided by total bitcoin held. That is the whole formula. People often assume it equals the average of the prices they paid. It does not, because a fixed-dollar purchase buys more bitcoin when the price is low. A $100 buy at $20,000 gets five times the bitcoin of a $100 buy at $100,000. So it pulls the average down five times as hard. That asymmetry is the entire mechanical argument for dollar-cost averaging. It falls out of the arithmetic, not out of any claim about future prices.

In most jurisdictions acquisition fees are added to basis. A purchase with a 1% fee therefore has a slightly higher basis per coin than the raw price suggests. The worked example below uses a zero fee to keep things clean. The tracker lets you set a fee per position.

A worked example on real prices

$100 bought every week since Aug 17, 2021, priced against real Kraken history and valued at the live price of $63,514.

Position

Purchases (tax lots)261
Total invested$26,100
Bitcoin held0.61500657 BTC
Average cost basis$42,439

Against today's market

Price now$63,514
Value now$39,061
Unrealized gain+$12,961 (+49.7%)
Cheapest / priciest lot$16,435 / $121,978

Note the gap between the cheapest and priciest lot. Both are yours, both are bitcoin, and on-chain they are indistinguishable. For tax purposes they are very different assets. That is the whole reason lot accounting exists.

Why DCA creates hundreds of tax lots

A single tax lot is one purchase: a date, a quantity, and a cost. Buying weekly creates 52 of them a year whether you notice or not, which is how the example above ended up with 261. While you are only accumulating, none of it matters. The moment you sell, spend, or swap any bitcoin, the question becomes: which bitcoin did you dispose of? Your wallet cannot answer that, because one unit of bitcoin is interchangeable with any other. Your records have to.

Here is what that choice is worth, using the same schedule as above.

Selling 0.15375164 BTC today for $9,765

A quarter of the stack, same disposal, three different lot-selection rules.

Lots usedCost basisReported gain
Oldest first (FIFO)$5,510$4,255
Newest first (LIFO)$12,288-$2,523
Most expensive first (HIFO)$12,386-$2,621

Same bitcoin, same sale price, $6,876 of difference in the gain you report this year. The totals converge once you eventually dispose of everything. Lot selection moves gains between tax years. It does not erase them.

Two practical consequences. First, if you ever intend to select lots, you need the records in place before the sale, not reconstructed afterwards. Second, moving bitcoin between your own wallets is generally not a disposal, but your basis has to travel with it. Once coins have moved between platforms, no single exchange has the history to work it out for you.

FIFO, HIFO and specific identification, as concepts

These are accounting conventions for matching a disposal to the purchases behind it. Which of them you are allowed to use depends entirely on where you are tax resident. So does whether you get a choice at all. And the rules change. What follows is the shape of the ideas, not guidance on which to apply.

FIFO: first in, first out

The oldest bitcoin you bought is treated as the bitcoin you sold. It is the default assumption in many jurisdictions and the easiest to defend. All it needs is the order of your purchases, with no extra record-keeping. For a DCA plan running through a rising market, FIFO tends to match your sale against your cheapest, oldest lots. That usually produces the largest reported gain.

LIFO: last in, first out

The most recent purchase is treated as the one sold. It matches against your newest lots, which after a rally are typically your most expensive. LIFO is not permitted everywhere. Where it is permitted, it usually needs the same record-keeping as specific identification.

HIFO: highest in, first out

The most expensive lots go first, which minimizes the reported gain on this disposal. In most places HIFO is not a separate legal method. It sits inside specific identification as a strategy, so it only holds up if your records actually identify which units you sold.

Specific identification

You nominate exactly which units you are disposing of. This is the mechanism that makes HIFO, or any other selection, possible. The price of admission is documentation: the acquisition date, quantity, cost, and disposal details of each unit. You have to identify them at or before the time of the sale, rather than reconstruct them afterwards. Requirements differ by jurisdiction and are strict where they exist.

Pooling / average cost

Some jurisdictions do not let you choose lots at all. The UK, for example, pools identical assets into a single holding with one averaged cost, plus same-day and 30-day matching rules. Canada uses an averaged adjusted cost base. Under a pooling regime the average cost basis this page calculates is more than a summary statistic. It is close to the number that actually matters.

What to record for every purchase

Exchanges close, delist users, and lose export history. Keeping your own copy costs a few minutes a month and is the difference between a calculation and a guess.

  • Date and time of each purchase, in a consistent timezone
  • Fiat amount spent and the currency it was spent in
  • Quantity of bitcoin received, after fees
  • The fee charged, listed separately from the amount. In most jurisdictions acquisition fees are added to your basis
  • The exchange or venue, and the account it happened in
  • For withdrawals: the destination wallet and the on-chain transaction ID
  • For disposals: date, quantity, proceeds, and which lots you identified

Spending bitcoin on goods is a disposal in most jurisdictions, at the market value on the day. So is swapping it for another asset. Sending it to your own hardware wallet usually is not, but you should still record the transfer so your basis stays traceable across wallets.

Track your own positions

Add each DCA schedule you have actually run: a label, the date range, the amount per buy, the cadence and the fee. The tracker backtests each one against historical prices and shows the combined average cost basis across all of them. Positions persist in this browser only and there is no account. The only thing that reaches our server is the date range they span, which is what the price lookup needs. The amounts and the results stay on your device.

Cost Basis Tracker

Nothing saved yet. Add a plan to see what you paid per BTC.

This page opens on prices from Aug 3, 2016 onward. Once you add a position, the tracker loads whatever range your own positions actually span, back to Aug 18, 2010. That is the first day with real market data. Amounts are stored in USD and displayed in whichever currency you have selected. Nothing you enter leaves your browser.

This is not tax advice

Rules for cost basis, permitted accounting methods, record-keeping standards and what counts as a taxable disposal vary by country. They also change from year to year. Nothing here knows your jurisdiction, your residency, or the rest of your transaction history. None of it has been reviewed by a tax professional. Use these figures to understand your position and to plan. Before you file, use a qualified accountant or a dedicated tax tool in your country.

Frequently asked questions

What is cost basis for bitcoin?

Cost basis is what you paid to buy the bitcoin you hold. In most jurisdictions that includes the fees you paid to acquire it. When you sell, spend or swap bitcoin, that counts as a disposal. Your gain or loss is the proceeds minus the basis of the specific units you disposed of. Your average cost basis is total spent divided by total bitcoin held. It is a useful summary of your position, and in pooling jurisdictions it is close to the figure the tax calculation itself uses.

How do I calculate my average cost basis?

Divide everything you have spent by all the bitcoin you hold. In the worked example on this page, $26,100 across 261 weekly purchases bought 0.61500657 BTC, giving an average cost of $42,439 per bitcoin. That is not the same as averaging the prices you paid. Each purchase is weighted by how much bitcoin it actually bought, so cheap buys count for more than expensive ones.

Why does DCA create so many tax lots?

Every purchase is its own tax lot: a date, a price, and a quantity. Tax rules generally track disposals against those individual purchases rather than against a single blended pile. A weekly schedule creates 52 lots a year. The 5-year example on this page has 261. None of that is a problem while you are only buying. It becomes work the moment you sell, spend, or move bitcoin between platforms.

Does the method I choose change how much tax I owe?

It changes the timing and size of the gain you report on a given sale. In the example above, disposing of the same 0.15375164 BTC costs $5,510 under FIFO and $12,386 under HIFO. That is a difference of $6,876 in reported gain on one transaction. Over your whole holding period the total gain is the same either way. What changes is which year you recognize it in, and in some systems whether it is taxed at long-term or short-term rates. Whether you may choose at all depends on your jurisdiction.

Does the data I enter here leave my browser?

No. The tracker stores your positions in your browser's local storage, under a single key. Every figure is computed on your device from price data already loaded with the page. Nothing is sent to a server, there is no account, and we never see it. The flip side: clearing your browser data deletes your positions, and they do not follow you to another device or browser. Keep your own records elsewhere.

Is this tax advice?

No. This page explains concepts and does arithmetic. It does not know your jurisdiction, your residency, your other transactions, or the rules that apply to you. Those rules also change. Treat every number here as an estimate for planning and understanding. Before you file anything, use a proper tax tool or an accountant who works with digital assets in your country.

Run your own numbers

The full calculator backtests any schedule against real historical prices. You get your average cost, every individual purchase, fees paid, and a downloadable CSV of the lot-by-lot detail.

Open the calculator

Related

Not financial advice and not tax advice. Figures are historical simulations for education; past performance does not guarantee future results, bitcoin is volatile, and you can lose money.