Transactions
Cost basis and crypto taxes (US overview)
When you sell crypto for more than you paid, you may have a capital gain; if less, a capital loss. Cost basis is what you paid (including fees in many cases). FIFO, LIFO, and average cost are different ways to match sells to earlier buys when you have multiple purchases.
This calculator helps you explore those totals for simple buy/sell histories. It does not handle every taxable event (swaps, income, wash sales, multi-wallet consolidation) and does not apply federal or state tax rates. For complex portfolios, use specialized crypto tax software or a qualified CPA.
Read our Crypto Tax Guide: FIFO, LIFO & Cost Basis Explained for a deeper explanation, examples, and FAQs.
How is cryptocurrency taxed in the U.S.?
The IRS treats cryptocurrency as property for federal tax purposes. Selling, trading, or spending crypto for more than your cost basis generally creates a capital gain or loss.
When you have multiple purchases, you must match sells to buys using a cost basis method (FIFO, LIFO, or average cost). This calculator summarizes gains and losses from simple buy/sell histories—it does not apply tax rates.
Formula
Gain/loss per sale = Proceeds − Cost basis (matched to prior buys)
Total gain = Sum of positive results
Total loss = Sum of negative results (absolute value)
How the calculation works
- Enter buy and sell transactions with dates and amounts.
- Select FIFO, LIFO, or average cost to match sells to buys.
- Calculate gain or loss for each sell.
- Summarize totals for planning (not filing).
Worked examples
FIFO with two buys and one sell
- Buy 1: 1 BTC at $30,000
- Buy 2: 1 BTC at $40,000
- Sell: 1 BTC at $50,000 — FIFO uses Buy 1 basis
Gain = $50,000 − $30,000 = $20,000 on that lot. Remaining inventory still includes Buy 2.
Practical uses
- •Understanding cost basis matching before using tax software
- •Comparing FIFO vs LIFO outcomes on the same history
- •Year-end planning conversations with a CPA
Limitations
- !Does not handle every taxable event (staking income, airdrops, swaps, NFTs)
- !No federal or state rate application
- !Not a substitute for Form 8949 or professional filing
References
Read our in-depth guide for more detail.
How This Calculator Works
Enter buys and sells
List each transaction with date, type, quantity, price, and fees.
Pick a matching method
FIFO, LIFO, or Average Cost determines how sells consume purchase lots.
View gains and losses
See totals for proceeds, cost basis, gains, losses, and net result.
What is Crypto Tax Calculator?
Crypto tax is the capital gains tax owed when cryptocurrency is sold, swapped, or spent. Gain equals proceeds minus cost basis, and the basis depends on the matching method used: FIFO sells the oldest coins first, LIFO the newest, and average cost blends every purchase.
Add buy and sell transactions, choose a cost basis method, and calculate total gains, losses, and net result. Calculations run in your browser. Output is an estimate for education and planning— not IRS filing software.
FIFO
Matches sells to your oldest purchase lots first.
LIFO
Matches sells to your newest purchase lots first.
Average cost
Uses a blended average price across remaining holdings.
Last updated: · Published:
How to Use This Tool
Add transactions
Enter buy and sell rows with date, amount, price per unit, and optional fees.
Choose cost basis method
Select FIFO, LIFO, or Average Cost to match sells with purchases.
Calculate
The tool pairs sells with buys and totals gains, losses, proceeds, and cost basis.
Review net result
See total gains, losses, and net gain or loss—not an estimated tax payment.
Consult a professional
Use results for planning; a CPA or crypto tax software is needed for accurate filing.
Pro Tips
- This tool summarizes gains and losses—it does not calculate tax owed
- FIFO is common for matching lots, but holding period still affects tax rates
- Swaps, staking rewards, and airdrops may be taxable—track them separately
- Keep exchange CSV exports and wallet history for complete cost basis
- Consider our capital gains calculator for a single sale estimate
- Speak with a tax professional before filing