Crypto Tax Cost Basis Calculator
Crypto capital gains tax estimate.
Formula
FIFO method tax calculation
Example
Bought at $30K, sold at $50K → tax based on holding period.
Embed this calculator on your site
Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.
<iframe src="https://calcnestai.com/embed/crypto-tax-cost-basis-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Crypto Tax Cost Basis Calculator — Free Tool by CalcNest AI"></iframe>
Understanding the Crypto Tax Cost Basis Calculator
A crypto cost basis calculator works out the gain on a disposal and estimates the tax on it. The arithmetic is simple; the hard part in practice is knowing your cost basis at all, because crypto activity generates far more taxable events than most people realise and the records to support them are frequently missing.
How it actually works
Enter buy price, buy quantity, sell price, sell quantity, your tax bracket, and whether the holding qualifies as long term. The calculator multiplies buy price by the quantity sold for cost basis, does the same at the sell price for proceeds, takes the difference as the gain, applies a rate, and reports the tax and net proceeds. Buying 2 units at $2,000 and selling at $3,500 gives a $4,000 basis, $7,000 proceeds, a $3,000 gain, and at a 24% bracket held long term, roughly $432 in tax.
| Bracket | Short term rate | Short term tax | Long term tax |
|---|---|---|---|
| 12% | 12.0% | $360 | $216 |
| 22% | 22.0% | $660 | $396 |
| 24% | 24.0% | $720 | $432 |
| 35% | 35.0% | $1,050 | $600 |
The deeper context most people miss
One caveat sits at the front, because it affects every figure above. This calculator estimates the long-term rate as 60% of your bracket capped at 20%, which is a rough approximation. Actual US long-term capital gains use a separate bracket schedule based on total taxable income, where lower-income taxpayers can owe nothing and only higher earners reach the top rate. Treat these figures as scale estimates rather than filing numbers.
Why crypto generates far more taxable events than people expect
The single most common and expensive misconception is that tax applies only when converting crypto to conventional currency. In most jurisdictions that treat crypto as property, including the US, a disposal occurs whenever you dispose of one asset for another, and that includes trading one token for a different token. Someone who bought Bitcoin, later swapped it for Ethereum, then swapped that for a third token, and never once touched a bank account has triggered two taxable disposals and owes tax on the gains at each step, in currency they may not have. This catches people out badly in volatile markets, where a large gain realised through a swap in one year can be followed by a collapse in value before the tax is due, leaving a real cash liability against an asset that no longer covers it. Beyond swaps, other events commonly trigger tax: spending crypto on goods or services is a disposal of the crypto at its value that day, receiving staking rewards or mining income is generally ordinary income at the value when received, and receiving tokens from an airdrop or a fork often is too. Converting to a stablecoin is still a disposal even though the value is pegged. Each of these also establishes a new cost basis for the asset received, which is why record-keeping compounds so quickly. Someone with a few hundred transactions across several platforms can face a genuinely difficult reconstruction problem at filing time, which is why dedicated crypto tax software has become close to essential for active participants.
A worked example: why which units you sold matters
Suppose you bought 1 unit at $1,000 in year one, 1 unit at $3,000 in year two, and now sell 1 unit at $4,000. Your gain depends entirely on which unit you're deemed to have sold. Under first-in-first-out, the default in many circumstances, you sold the $1,000 unit for a $3,000 gain. Under a specific identification method, if permitted and properly documented, you could nominate the $3,000 unit and report a $1,000 gain instead, cutting the taxable amount by two thirds. Under an average cost approach, used in some jurisdictions including the UK with its own pooling rules, the basis would be $2,000 and the gain $2,000. Same sale, three defensible answers ranging from $1,000 to $3,000 of taxable gain, depending on method and jurisdiction. There's a second dimension: the $1,000 unit has been held over a year and qualifies for long-term treatment, while the $3,000 unit may not, so the lower gain might be taxed at a higher rate. Working out which combination produces the better outcome requires knowing both figures, which requires records. The practical point is that specific identification, where available, is worth real money, but only if you have contemporaneous documentation of which lots you disposed of, which means the decision has to be made and recorded at the time of sale rather than reconstructed later.
Deciding when to realise a gain or a loss
Because the holding period materially changes the rate, timing is a genuine lever. On a $3,000 gain at a 24% bracket, short-term treatment costs $720 while long-term treatment under the real US schedule would typically be $450 at the 15% rate, so selling a few weeks before the one-year mark costs around $270 for no reason other than timing. Checking the acquisition date before disposing is a habit worth building. Loss harvesting is the other side, and crypto has historically had an unusual feature here: the wash sale rules that prevent claiming a loss on securities repurchased within a set window have not always applied to assets classified as property rather than securities, which meant some investors could sell at a loss and immediately repurchase, banking the loss while retaining the position. This is an area of active legislative attention and the treatment has been changing, so anyone relying on it should confirm the current rules in their jurisdiction rather than assuming what was true a few years ago still holds. More generally, realised losses offset realised gains, and in many jurisdictions excess losses can offset a limited amount of ordinary income with the remainder carried forward, so a year with large gains is worth reviewing for positions you no longer want that could be sold to offset them.
Why record-keeping is the actual problem
The calculation is easy and the inputs are hard. Crypto records fragment across exchanges that may no longer exist, wallets you controlled at different times, protocols with no reporting at all, and transfers between your own addresses that look like disposals unless documented otherwise. Exchange reporting in this area has historically been inconsistent, and even where forms are issued, they often report gross proceeds without cost basis, because the exchange has no visibility of what you paid if the asset arrived from elsewhere. That leaves the taxpayer responsible for establishing basis, and the consequence of failing to do so is severe: without evidence of what you paid, a tax authority may treat the basis as zero, making the entire proceeds taxable. On a $7,000 sale that turns a $432 liability into something several times larger. The practical response is to export transaction history from every platform at least annually while you still have access, keep records of on-chain transfers with the wallet addresses involved, record which lots you're disposing of at the time of sale if you intend to use specific identification, and note the value in your local currency at the time of each transaction rather than trying to reconstruct historical prices later. For anyone with more than a handful of transactions, dedicated tracking software that connects to exchanges and wallets is far cheaper than the professional time required to reconstruct a fragmented history.
Variations: FIFO, specific identification, and jurisdictional differences
Accounting method matters and availability varies. First-in-first-out treats the earliest acquired units as sold first and is the common default, which in a rising market tends to produce larger gains but more often qualifies for long-term rates. Last-in-first-out and highest-in-first-out approaches can reduce current gains but may sacrifice long-term treatment, and their availability depends on jurisdiction and on maintaining adequate records. Specific identification lets you nominate exactly which units were disposed of, which offers the most control and demands the most documentation. Some jurisdictions mandate their own approach entirely: the UK uses share pooling rules with same-day and 30-day matching provisions, Canada uses an adjusted cost base averaging method, and other countries differ again, so an approach that is standard in one place may be unavailable in another. Some jurisdictions also apply different treatment based on whether activity constitutes investment or trading, which can shift gains from capital treatment to income treatment at considerably higher rates. Because of this variation, the specific rules where you file matter more than any general guidance.
Handling crypto cost basis properly
Track every disposal, not just conversions to conventional currency, since token-for-token swaps, spending crypto, and often receiving staking rewards or airdrops are all taxable events in jurisdictions treating crypto as property. Export full transaction history from every exchange annually while you still have access, since platforms close and historical data becomes unrecoverable. Record the local-currency value at the time of each transaction rather than reconstructing prices later. If you intend to use specific identification, document which lots you're disposing of at the time of the sale rather than after. Check acquisition dates before selling, since crossing the one-year mark can meaningfully reduce the rate. And treat this calculator's long-term estimate as a rough scale figure, since actual long-term rates follow their own bracket schedule.
What people get wrong
- Assuming tax applies only when converting to conventional currency, when token-for-token swaps are disposals in most jurisdictions treating crypto as property.
- Failing to keep records of what you paid, which can result in a basis of zero being assumed and the entire proceeds taxed.
- Selling shortly before the one-year holding mark, forfeiting long-term treatment that can cut the rate substantially for no reason other than timing.
- Assuming an accounting method is available without checking, when jurisdictions mandate different approaches and specific identification requires contemporaneous documentation.
Where the math comes from
Cost Basis = Buy Price × Sell Quantity. Proceeds = Sell Price × Sell Quantity. Gain = Proceeds - Cost Basis. If held long term, the rate is estimated as min(Bracket × 0.6, 20%); otherwise the full bracket applies. Tax = max(Gain, 0) × Rate / 100. The long-term rate here is a simplification: actual long-term capital gains use a separate bracket schedule based on total taxable income and filing status.
Questions and answers
Are these returns guaranteed?
No. DeFi yields can change daily based on protocol activity, token price moves, and liquidity changes. The calculator computes returns at the input rate; that rate is itself volatile.
How is this taxed?
In the US, every swap, staking reward, and airdrop is potentially a taxable event at the time of receipt. Track all transactions; tax software designed for crypto (Koinly, CoinTracker) helps significantly.
What is impermanent loss?
When you provide liquidity to a pool with two assets, divergent price moves between them produce a 'loss' relative to just holding the assets. The loss becomes permanent when you withdraw; if prices revert, it goes away.
How risky are these protocols?
Smart contract risk (bugs, exploits) is real and varies by protocol. Audits help but do not eliminate risk. Established protocols with multiple audits and long track records carry less risk than new ones.
Should I use leverage?
Leverage multiplies both gains and losses. In crypto, where 30%+ price moves happen regularly, leverage can liquidate positions in hours. Most prudent investors avoid it or limit to small allocations.
Is swapping one crypto for another taxable?
In most jurisdictions that treat crypto as property, including the US, yes. Trading one token for another is a disposal of the first asset and triggers a gain or loss even though no conventional currency was involved. This surprises many people and can create a real cash tax liability against assets that later fall in value.
What is cost basis and why does it matter?
It's what you paid for the asset, and it determines the taxable gain on disposal. Without records establishing basis, a tax authority may treat it as zero, making the entire sale proceeds taxable. On a $7,000 sale that can multiply the liability several times over, which is why record-keeping matters more than the calculation itself.
Which accounting method should I use?
It depends on your jurisdiction and your records. First-in-first-out is the common default and tends to produce larger gains in a rising market but more often qualifies for long-term rates. Specific identification offers the most control but requires documenting which lots you disposed of at the time of sale. Some jurisdictions mandate their own approach entirely.
Is this calculator's long-term rate accurate?
It's an approximation, using 60% of your bracket capped at 20%. Actual US long-term capital gains follow a separate bracket schedule based on total taxable income and filing status, under which lower-income taxpayers may owe nothing and only higher earners reach the top rate. Use it for scale, then check current tables before filing.
Are staking rewards and airdrops taxable?
Generally yes, and often as ordinary income at their value when received rather than as capital gains. That value then becomes the cost basis for any later disposal, which itself triggers a separate capital gain or loss calculation. This two-stage treatment is a common source of both confusion and under-reporting.
Do wash sale rules apply to crypto?
Historically they have not always applied to assets classified as property rather than securities, which allowed selling at a loss and immediately repurchasing. This has been an area of active legislative attention and the treatment has been changing, so anyone relying on it should confirm the current rules in their jurisdiction rather than assuming past treatment still holds.
How should I keep records?
Export full transaction history from every exchange at least annually while you still have access, since platforms close and data becomes unrecoverable. Record local-currency values at the time of each transaction, document on-chain transfers between your own wallets so they aren't mistaken for disposals, and for more than a handful of transactions, use dedicated tracking software.
Sources & References
Authoritative references consulted in building this calculator and educational content. These are primary sources — check directly for the most current figures.
Related calculators
Liquidity Pool Returns · Yield Farming APR · Crypto Profit · Staking Rewards · Crypto DCA Strategy