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 you have the records a tax calculation is built from. This page does both. First a worked example on historical 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. Nothing you enter is sent to us: not the dates, not the amounts, not the labels. The price history the tracker needs is public and loads with this page. What the page may still fetch is the same for every visitor: today's exchange rates if you use a currency other than US dollars, and a fresh copy of the whole price history if this page's copy has fallen more than three days behind while you have a position saved.
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 historical prices
$100 bought every week since Oct 12, 2021, priced on Coinbase's daily closing prices and valued at $82,489, the Coinbase price on Oct 12, 2026 at 22:44 UTC. This page is recalculated about once a day, so that price is not a live one. No fee is applied.
Position
At the Oct 12 price
Note the gap between the cheapest and priciest lot. Both are yours, both are bitcoin, and on-chain they are indistinguishable. Where tax is tracked lot by lot they are very different assets: sell the cheap one and the reported gain is large, sell the expensive one and it is small. 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. That is how a lot-based tax system sees your buying. A pooling system, covered further down, averages the purchases into one holding instead, though each one still has to be recorded. Buying weekly creates 52 purchases 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.15228073 BTC at the Oct 12 price, for $12,561
A quarter of the stack, same disposal, three different lot-selection rules.
| Lots used | Cost basis | Reported gain |
|---|---|---|
| Oldest first (FIFO) | $4,992 | $7,570 |
| Newest first (LIFO) | $12,310 | $251.43 |
| Most expensive first (HIFO) | $12,452 | $109.41 |
Same bitcoin, same sale price, $7,460 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. It needs the order of your purchases and, where the order is applied wallet by wallet, which wallet or account each one is in. 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. Some systems apply the order inside each wallet or account, not across everything you hold. The United States has done so since 2025; see the note below this list.
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.
United States: per wallet and per account since 2025
What the IRS has published, as read on Oct 12, 2026. This describes US federal rules only. It is not advice, and these rules are still being phased in.
- Lot rules apply inside each wallet or account, not across everything you hold. The final regulations apply to acquisitions and disposals of digital assets on or after January 1, 2025, and Rev. Proc. 2024-28 describes them as applying the specific identification and first-in, first-out rules to units "held within a single wallet or account".
- If you do not identify specific units, the IRS FAQs on digital asset transactions say they are treated as leaving "in order of time from the earliest date on which units of the same digital asset in this wallet were acquired by you", whatever date they were moved into that wallet. That is first in, first out, counted wallet by wallet. The FAQs give the same order for units held in a broker's custody.
- Brokers report sales on Form 1099-DA. The IRS says they must report gross proceeds for transactions on or after January 1, 2025, and basis for "certain transactions" on or after January 1, 2026.
- Under the 2026 instructions for that form, a broker has to report basis only for a covered security: a digital asset acquired after 2025 in an account where that broker provided custody, and held in that account until it was sold. For anything else, including bitcoin bought before 2026 or moved in from elsewhere, basis reporting is voluntary, so the form can arrive with no basis figure for those coins.
Sources:
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. A plan you are still running can have an end date in the future. It is counted up to today, never beyond. Positions persist in this browser only and there is no account. Nothing about them reaches our server.
Cost Basis Tracker
Nothing saved yet. Add a plan to see what you paid per BTC.
The price history loads with this page and runs from Aug 18, 2010, the first day we have a price for, to Oct 12, 2026: Coinbase's daily closes from Jul 20, 2015, and before that blockchain.info's daily average market price. Plans are valued at $82,489, the Coinbase price on Oct 12, 2026 at 22:44 UTC. Each plan keeps the amount and currency you typed. 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 what you disposed of: the specific units where tax is tracked lot by lot, a share of one averaged pool where it is not. 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.60912293 BTC, giving an average cost of $42,848 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 record: a date, a price, and a quantity. Where tax is worked out lot by lot, each one is also its own tax lot, and a disposal is matched against those individual purchases. Some countries instead pool identical coins into one holding with an averaged cost. The purchases still have to be recorded there, but they are not matched one by one. A weekly schedule adds 52 purchases 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.15228073 BTC costs $4,992 under FIFO and $12,452 under HIFO. That is a difference of $7,460 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, and every figure is computed on your device. The price history it needs is public and loads with this page, so pricing a position sends nothing. Two requests can follow, and neither carries any of your data. If you use a currency other than US dollars, the page fetches today's exchange rates. And if the newest price in the page's copy of the history is more than three days behind today while you have a position saved, the tracker downloads a fresh copy of the whole price history from our server. Both requests are identical for every visitor and contain no date, amount or label of yours. There is no account. 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 historical prices. The button opens it on the worked example above, same schedule, same price series and no fee, so you can check the figures and then change them. You get your average cost, every individual purchase, fees paid, and a downloadable CSV of the purchase-by-purchase detail.
Open the calculatorRelated
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.