How to Calculate Crypto Gains Step by Step
You've bought Bitcoin on one exchange, moved it to a hardware wallet, swapped some Ethereum for another token, and received staking rewards without ever touching fiat. Now tax season has arrived, and the exchange report shows proceeds but not the cost basis you remember recording. Learning how to calculate crypto gains starts with a simple formula, but accurate results depend on the bookkeeping behind every disposal, transfer, reward, fee, and lot.
This guide treats your transaction history like a working ledger. You'll learn how to identify taxable disposals, match each sale or swap to the right acquisition lot, handle U.S. and UK rules, and check a calculator's output before you rely on it. The math is usually straightforward. The difficult part is making sure every row tells the truth.
Table of Contents
- Why Calculating Crypto Gains Feels Harder Than It Should
- The Core Formula and What Counts as a Disposal
- Choosing a Cost Basis Method That Lowers Your Bill
- Handling Swaps Staking Rewards Bridges and Other Edge Cases
- Country Specific Rules That Change Your Math
- Using Calculators and Spreadsheets Without Trusting Them Blind
- A Repeatable Workflow and Habits That Keep Records Clean
Why Calculating Crypto Gains Feels Harder Than It Should
Tax season can expose a ledger problem before it exposes a math problem. You may have six exchange accounts, two self-custody wallets, several DeFi protocols, and an export named tax_2024_final_v3 that still fails to reconcile. One platform may label a token swap a buy, another may call it a sale, while a wallet export shows only blockchain movements and no obvious purchase price.
The difficulty comes from records that describe the same activity differently. CSV files use different timestamps and asset symbols, fees may sit in a separate row, and staking rewards can increase your holdings without creating a cash deposit. A cross-chain bridge may appear as an outgoing transaction on one network and an incoming transaction on another, leading a calculator to count the same assets twice.
Practical rule: Treat every transaction as a bookkeeping event first and a tax event second.
Your first sorting task is to identify the event's owner and purpose. A transfer between an exchange and a wallet you control normally changes location, not ownership. A sale for dollars, a token swap, or spending crypto on a service changes what you own and must be assessed under the applicable tax regime. That classification determines whether a row feeds into the gain calculation or documents movement between your accounts.
A useful ledger records the details that move the result:
- Asset and quantity: Name the token and exact units involved.
- Acquisition or disposal date and time: Precise timing can affect lot matching.
- Fiat value: Record fair market value in the relevant currency at the event time.
- Cost basis: Preserve the amount assigned to the units disposed of.
- Fees: Separate acquisition costs, disposal costs, and transfer fees.
- Wallet or account: Show ownership and location clearly.
U.S. recordkeeping guidance calls for transaction-level details such as the digital asset type, acquisition and disposal dates and times, units, fair market value in U.S. dollars, and basis. The IRS explains the reporting path through Form 8949 and Schedule D in its Form 8949 instructions.
Small-business owners can also consult crypto tax tips for small business when personal wallets, business payments, and operating expenses overlap. The work is procedural more than mathematical. Once each row has an owner, date, value, event type, lot, and fee treatment, the gain figure becomes defensible.
The Core Formula and What Counts as a Disposal
Start with the transaction that changes ownership or gives you something in return. A realized gain is the profit or loss recognized when you dispose of an asset. An unrealized gain is only the change in value of crypto you still hold, so it remains a paper result until a disposal occurs.
For a basic calculation, use:
Gain = Proceeds − Cost Basis − Allowable Fees
The IRS describes the U.S. method as subtracting adjusted basis from the amount received on disposal. The agency also requires records that support the asset, timing, quantity, fair market value, and basis, as outlined in its virtual currency transaction FAQs.
A disposal commonly includes:
- Selling crypto for fiat currency.
- Swapping one token for another.
- Spending crypto on goods or services.
- Gifting crypto when the applicable gift rules make the transfer taxable.
For proceeds, record the fair market value of what you received at the time of the disposal, converted into the reporting currency. If you trade ETH for another token, the proceeds are generally the market value of the token received, not zero because no dollars entered your bank account.
Allowable fees need careful classification. Exchange commissions, network gas, and other costs directly connected to acquiring or disposing of an asset may affect the calculation, but local rules determine whether a particular fee increases basis, reduces proceeds, or requires separate treatment. Keep the fee asset, quantity, fiat value, and transaction hash in your ledger.

A worked calculation
Suppose you buy 1 ETH for $1,500 and later sell it for $1,800, paying $30 in fees. The calculation is:
$1,800 − $1,500 − $30 = $270 gain
That result is realized because the ETH was sold. By contrast, if you bought 0.5 ETH for $2,000 and its current value is $2,400, you have an unrealized $400 increase, but no disposal has occurred yet. Holding the asset alone doesn't turn that paper increase into a realized gain.
Good bookkeeping follows the same logic as double entry bookkeeping basics: every movement needs a corresponding explanation. A disposal should connect the asset leaving your wallet, the value received, the selected acquisition lot, and any related fee. That connection is what makes the final number auditable.
Choosing a Cost Basis Method That Lowers Your Bill
If you acquired the same token at different prices, the sale price alone doesn't determine your gain. You must decide which units were sold, then assign the matching basis to the disposal.
Consider four common methods:
| Method | How It Matches Lots | Best For | Default Status | Audit Risk |
|---|---|---|---|---|
| FIFO | Matches the earliest acquired units first | Long-term holders seeking simplicity | U.S. default when another method isn't properly documented | Lower if dates and quantities are complete |
| LIFO | Matches the most recently acquired units first | Active traders matching recent costs against recent proceeds | Not the U.S. default | Higher if identification isn't documented |
| HIFO | Matches the highest-cost units first | Investors seeking to reduce a current gain | Not the U.S. default | Higher if lot records are incomplete |
| Specific identification | Lets you select documented units or lots | Investors with precise wallet-level records | Permitted in the U.S. when requirements are met | Depends heavily on contemporaneous evidence |
The IRS allows specific identification when you can document each unit's unique digital identifier or maintain complete records for all units held in a particular wallet or account. Those records need acquisition date and time, quantity, basis, fair market value at acquisition, disposal date and time, and value received at disposal. If you can't substantiate the selected units, FIFO is the U.S. fallback described in the IRS guidance.
The choice can change the gain materially. A high-cost lot produces a smaller gain than a low-cost lot sold for the same proceeds, while a low-cost lot produces a larger gain. That doesn't mean HIFO is automatically the right answer. Your tax position, holding period, reporting method, and ability to prove the selection all matter.
The UK uses a different sequence
UK individual reporting doesn't default to FIFO. HMRC matches disposals first with acquisitions made on the same day, then with acquisitions made within the following 30 days, and finally with the Section 104 pool. The HMRC crypto matching rules explain this sequence.
The method that produces the smallest number on a spreadsheet is useless if your records can't prove the lot selection.
Apply one documented approach consistently within the relevant jurisdiction. Don't choose a method after seeing the tax result and assume the ledger will support it. Record the method, the account or wallet scope, the lot identifiers, and the evidence that links each disposal to those units.
Handling Swaps Staking Rewards Bridges and Other Edge Cases
Crypto activity rarely arrives as a neat buy followed by a fiat sale. A swap, reward, airdrop, or bridge can create several linked records, and each one needs its own classification.
A token-to-token swap is generally treated as a disposal of the token you give up. Measure proceeds using the fair market value of the token received at the swap time, subtract the selected basis and allowable costs, then open a new lot for the token received using that market value as its starting basis.
Suppose you acquired 1 ETH for $1,500 and swap it when the received token is worth $1,800. Before fees, the ETH disposal creates a $300 gain, and the new token receives an $1,800 basis. The ledger therefore needs two linked rows, one for the ETH disposal and one for the new asset acquisition.
Staking and yield rewards require two stages. At receipt, record the reward's fair market value as income where the applicable rules treat it as income. That same recorded value becomes the reward's basis. If the reward later rises in value and you dispose of it, calculate a separate capital gain or loss from the receipt value to the disposal value.
Airdrops need similar care. Record income when you have control of the tokens and can use them, then establish basis using the reported value required by the applicable tax system. If the tokens have no reliable market value at receipt, preserve the evidence you used and obtain local professional guidance rather than inserting an arbitrary figure.
| Event | Tax Event? | Income vs Capital | How to Record |
|---|---|---|---|
| Token-to-token swap | Usually a disposal of the token given up | Capital result on the disposed token | Record received value, matched basis, fees, and a new lot for the token received |
| Staking reward | Often an income event at receipt | Income first, capital result later | Record receipt value and carry it as basis |
| Airdrop | Income when you control the asset under applicable rules | Income first, capital result later | Record control date, value, quantity, and later disposal |
| Self-transfer between wallets | Generally not a disposal when ownership stays the same | Neither, unless a fee or special conversion creates a separate event | Link sending and receiving transactions and preserve the transaction hash |
| Cross-chain bridge | Depends on whether beneficial ownership and the asset remain unchanged | Potentially non-taxable transfer, or capital event if wrapped or exchanged | Record source asset, destination asset, bridge contract, and any wrap or unwrap |
A bridge that moves the same beneficial ownership and asset between networks may be a transfer rather than a disposal. A wrap or unwrap can change the asset received, however, so don't label every bridge transaction “non-taxable” automatically. Review the actual contract action, especially across Ethereum, Layer 2 networks, and DeFi protocols. For background on the network context behind staking, see Ethereum proof of stake.
Country Specific Rules That Change Your Math
The same wallet history can produce different tax results in the United States and the United Kingdom. The difference comes from how each system matches disposed units to their cost, and from the records needed to support that choice.
In the U.S., the general calculation is proceeds minus adjusted basis. Holding period also matters. Crypto held for more than one year generally falls under long-term capital-gains treatment, while shorter holdings generally use ordinary-income rates, as described in IRS capital-gains guidance. Specific identification may be used when the taxpayer can document the units selected. Without adequate records, FIFO is the default described in the guidance.
The UK starts with disposal proceeds, subtracts acquisition costs and allowable expenses, and totals the resulting gains for the tax year. HMRC applies same-day matching first, followed by the 30-day rule, then Section 104 pooling. The HMRC pooling guidance requires records of the amount spent on each token type and the pooled allowable cost for each pool.
A simple comparison
Assume a UK investor holds two units of the same token in a Section 104 pool. The pool contains £1,000 of allowable cost, giving an average pooled basis of £500 per unit. The investor sells one unit for £800, and no same-day or 30-day acquisition overrides the pool.
The UK calculation is:
£800 proceeds − £500 pooled basis = £300 gain
A U.S. investor with two separately documented lots might have one unit with a $300 basis and another with a $700 basis. If FIFO applies and the lower-cost unit is sold for $800, the gain is $500. If the investor properly identifies the higher-cost lot, the gain is $100 instead. The sale price is the same, but the matching rule and supporting evidence change the result.
| Rule Area | US (IRS) | UK (HMRC) |
|---|---|---|
| Core calculation | Proceeds minus adjusted basis | Proceeds minus acquisition cost and allowable expenses |
| Lot matching | FIFO default, specific identification permitted with records | Same-day, then 30-day, then Section 104 pooling |
| Fees | Transaction records must support the treatment | Allowable fees can affect the computation |
| Annual threshold | Depends on the taxpayer's wider tax position | The annual exempt amount is £3,000 for 2026/27, according to HMRC's crypto guidance |
| Rates cited in the guidance | Shorter holdings generally use ordinary-income rates, longer holdings generally use long-term capital-gains rates | Crypto CGT rates are cited at 18% for basic-rate taxpayers and 24% for higher or additional-rate taxpayers for the stated period |
In the UK, allowable losses generally reduce gains before the annual exempt amount is applied. That ordering matters because the taxable figure is based on the remaining net gain, not on gross proceeds or each profitable disposal viewed alone.
These are general comparisons, not personal tax advice. Residency, domicile, income, business activity, and local reporting obligations can change the result. For a practical explanation of converting Bitcoin values into sterling, see BTC to GBP, then retain evidence for the exchange rate and confirm the filing treatment that applies locally.
Using Calculators and Spreadsheets Without Trusting Them Blind
Tax software can process thousands of rows, but it can't always infer what happened. An imported transaction labeled “receive” might be a staking reward, a self-transfer, an airdrop, or a deposit from an unknown wallet. The software needs your classification before it can apply the right basis and income treatment.
Start with a source inventory:
- Export transaction histories from every centralized exchange.
- Export wallet activity from each chain and self-custody address.
- Download records from DeFi protocols, staking providers, and bridge interfaces.
- Preserve the original files before editing them.
- Add a wallet or account label to every row.
Next, normalize the data. Convert timestamps to one consistent timezone, standardize token symbols, identify duplicates, and map each row to a category such as buy, sell, swap, reward, airdrop, bridge, transfer, gift, or fee. A transfer between two wallets you control should connect as one movement, not appear as an unexplained sale and a fresh purchase.
Three manual checks
Check one disposal from a low-complexity exchange. Recalculate proceeds, selected basis, and fees by hand.
Check one swap. Confirm that the tool recognized the asset given up as the disposal and created a new basis for the asset received.
Check one reward. Verify the receipt value, income classification, and later basis. If the reward never produced a cash inflow, that doesn't by itself eliminate the need to record the event where local rules treat it as income.
Also review bridge transactions, DeFi contract interactions, wrapped tokens, foreign-currency conversions, and gas paid in a token other than the asset being transferred. A calculator may classify a complex smart-contract call incorrectly because the blockchain event contains several token movements in one transaction.
For a smaller portfolio, a spreadsheet can work if you maintain a locked source-data tab, a normalized transaction tab, a lot ledger, and an adjustment log. A professional review becomes more valuable when you have cross-border residency, DeFi liquidity positions, multiple chains, business activity, missing basis, or a large number of disposals. Teams that need specialist support can also review options for remote tax talent for founders. For portfolio monitoring, a tracker such as best crypto portfolio trackers can complement tax records, but portfolio value and tax basis are different datasets.
A Repeatable Workflow and Habits That Keep Records Clean
A monthly close prevents a year-end reconstruction. Use the same loop each month, then lock the source files before making adjustments.
- Export CSVs: Within 48 hours of month-end, export records from every exchange and wallet. Keep dates, quantities, values, and basis available for later calculations.
- Tag transactions: Label buys, sells, swaps, staking rewards, airdrops, bridges, gifts, transfers, and fees. A transfer between your own wallets should connect the two records, not create an accidental disposal.
- Match cost basis: Apply your chosen method consistently. UK users should flag same-day, 30-day, and Section 104 activity, since lot matching and pooling can change the gain.
- Reconcile balances: Compare ledger quantities with exchange and wallet balances. Investigate unexplained dust, missing deposits, and possible dusting attacks.
- Review fees: Check maker and taker charges, network gas, priority tips, and fees paid in stablecoins or other tokens. Record the asset used for each fee.
- Archive evidence: Store blockchain transaction hashes, exchange statements, original CSVs, adjusted files, and final reports in a secure, encrypted location.

Four mistakes appear repeatedly. People omit a transfer row when moving assets between an exchange and self-custody, forget gas paid in a stablecoin, treat every wrapped-token bridge as merely a transfer, or reuse lots across tax years without maintaining the relevant pool. Each error can distort both balances and gains.
Keep original records for at least seven years where that matches your local obligation, and confirm the period with a tax professional. Reporting expectations are also becoming more formal. The OECD's Crypto-Asset Reporting Framework begins collecting data from January 1, 2026, in 48 jurisdictions, with first cross-border exchanges of information expected in 2027, according to coverage of CARF's reporting rollout. CARF includes relevant activity involving transfers, swaps, and retail payments, so cross-border records need more than a single exchange statement.
A stranger should be able to audit the ledger in an afternoon, following each disposal from acquisition through transfers, fees, proceeds, and tax treatment. That readable ledger is the deliverable of the workflow.
