How to calculate crypto profit and loss after fees and gas costs
16 mins read

How to calculate crypto profit and loss after fees and gas costs

Last updated: September 10, 2026

Key Takeaways

  • Did a $25 gas bill erase the gain?
  • For example, 1.25 BTC at $40,000 is $50,000 gross.
  • If you also paid $12 in gas to withdraw before selling, your net result is not $200.
  • If you bought 2 ETH for $3,000 each and ETH later trades at $3,200, your unrealized gain is not $400 until you actually sell.

Want the real crypto profit and loss number? Subtract every fee, plus every on-chain gas charge, from the trade result. Don’t just glance at buy price and sell price. Include exchange trading fees, withdrawal fees, deposit fees if any, blockchain gas, and any spread or slippage that changed your effective entry or exit price.

Who this is for, and what you need before you start

How to calculate crypto profit and loss after fees and gas costs

This is for anyone who has bought, sold, swapped, bridged, or moved crypto and now wants to know the true gain or loss on a position. It assumes you already have your transaction history, wallet addresses, and exchange statements, plus the token quantities and timestamps for each trade. No records? You can still do the arithmetic, but the answer may be partial.

I’m talking about calculation here, not tax advice. Crypto tax rules differ by country, and fee treatment can change by asset type, holding period, and account type. For your own filing situation, consult a qualified tax adviser or accountant, and check your local tax authority guidance, such as IRS Notice 2014-21 in the US or HMRC’s Cryptoassets Manual in the UK.

This method is handy when you need a clean answer to questions like: Did I actually make money after the 0.1% trading fee? Did a $25 gas bill erase the gain? Which trade was profitable before taxes, but not after costs? If you only want a quick app estimate, this is not the right tool. And it is not enough on its own if your country treats swaps, staking rewards, airdrops, or wrapped-token conversions as separate taxable events; confirm the treatment with a professional and the relevant guidance.

The cleanest way to think about this is:
Net profit or loss = total proceeds − total cost basis − all transaction costs tied to acquiring, holding, or disposing of the asset.

That formula looks neat. Reality is messier. The hard part is deciding which costs belong in the trade, which ones sit in your cost basis, and which ones are just transfer overhead. That’s where most bad calculations go off the rails.

What counts as profit and loss after fees and gas?

Profit and loss after fees and gas is what remains after you subtract the full cost of getting into and out of a position. For a simple spot trade, that usually means purchase price plus trading fee on the way in, and sale price minus trading fee on the way out. On-chain activity adds another layer: gas, the network fee paid to process a transaction on Ethereum, Solana, Bitcoin, or another chain.

Two labels matter here: realized P&L and unrealized P&L. Realized profit or loss is locked in once you close the position or convert the asset. Unrealized profit or loss is still on paper. If you bought 2 ETH for $3,000 each and ETH later trades at $3,200, your unrealized gain is not $400 until you actually sell. And if you paid $18 in gas to move the ETH between wallets, that cost still exists; it should be tracked because it affects your final economics and, in many tax systems, may affect your basis or disposal proceeds.

A generic article usually misses this in two ways. First, it ignores gas on transfers that are not the trade itself. Second, it treats every fee the same, which may not fit every accounting or tax setup. A trading fee charged by an exchange is usually part of trade cost. A network fee for withdrawing to a self-custody wallet is different from a fee paid to bridge assets across chains. A spread, the gap between the best bid and best ask, is not a line-item fee, but it can still change the price you actually got.

I would break the costs into four buckets:

  1. Acquisition cost: what you paid for the asset.
  2. Disposal proceeds: what you received when you sold or swapped it.
  3. Transaction fees: trading fees, withdrawal fees, bridge fees, gas.
  4. Price friction: spread and slippage, where slippage means the difference between your expected price and the price actually filled.

That split matters because the same $20 cost can land in a different bucket depending on what it was for. A $20 gas fee to move funds is not the same thing as a $20 fee charged by a brokerage on the trade ticket. Different bucket. Different effect.

How do I calculate crypto profit and loss after fees and gas costs?

How to calculate crypto profit and loss after fees and gas costs

Start from the ground up: entry cost, exit proceeds, and every cost attached to the position. The result is a net figure you can trust far more than the number shown by a chart app. Honestly, that difference gets ugly fast once fees pile up.

Here is the step-by-step method I use to think about it:

  1. List each taxable or trackable event. Write down the exact buy, swap, sell, bridge, or transfer for a single asset or lot. Include date, time, asset, quantity, and chain or venue. Verify that the quantities match across records. Missing a timestamp or asset code is a real problem because you may misclassify the event.
  2. Record the gross price first. Multiply quantity by executed price before fees. For example, 1.25 BTC at $40,000 is $50,000 gross. Use the filled price, not just the quoted one. If the fill price differs from the quote by more than expected spread or slippage, your source data may be incomplete.
  3. Add acquisition fees to cost basis. Include exchange trading fees, card fees, maker/taker fees, and any purchase commission. If the fee was taken in fiat, add it directly. If it was taken in crypto, convert that fee to fiat at the transaction time. Verify that the cost basis equals gross purchase value plus fee. A mismatch usually means you missed a fee line.
  4. Add transfer costs that belong to getting the asset into position. If you paid a network fee to withdraw to your own wallet before holding or staking, record that as part of your total cost trail. If you bridged across chains to access liquidity, record the bridge fee too. Verify whether the transfer was merely between your own wallets or part of a taxable move in your jurisdiction. If the transaction category is unclear, stop and classify it before calculating.
  5. Record the sale or swap proceeds net of disposal fees. Multiply the sell quantity by executed sale price, then subtract selling fees. If you swapped one token for another, many tax and accounting systems treat the token you gave up as disposed of and the token received as acquired at fair market value, but you should confirm the rule with a qualified professional. Verify the asset received has a clear market value at that timestamp. If not, the swap needs manual pricing.
  6. Subtract exit gas and disposal friction. Include network gas for the sell, swap, or bridge, plus exchange withdrawal fees if they were required to complete the exit. Verify that the fee was tied to this disposal. A fee paid later for an unrelated transfer should not be mixed into the trade.
  7. Apply the formula for the lot. Net profit or loss = net proceeds − total cost basis. Example structure: sell proceeds after fees minus buy cost after fees minus any qualifying gas associated with acquiring or disposing of the asset. Verify the sign: if the result is negative, it is a loss; if positive, it is a gain. A common mistake is subtracting a fee twice.
  8. Repeat lot by lot, not just coin by coin. If you bought the same asset at different times and prices, calculate each lot separately unless your tax method allows pooling or averaging. Verify that you are using the correct cost method for your jurisdiction and records. If not, the total can look right while the per-lot result is wrong.

A worked structure helps. Say you bought 0.5 ETH for $1,800 total, paid a $7 trading fee, and later sold it for $2,000 total with a $9 trading fee. If you also paid $12 in gas to withdraw before selling, your net result is not $200. Your rough economics are: sale proceeds $2,000 minus sale fee $9 = $1,991; total cost basis $1,800 plus buy fee $7 plus qualifying gas $12 = $1,819; net profit = $172. If your local rules treat that $12 gas differently, the tax outcome may change, so check the applicable guidance or ask a professional.

What should I include, and what should I leave out?

Include every cost that changed the economics of acquiring, holding, moving, or disposing of the asset. Leave out unrelated wallet activity that does not belong to that lot. Sounds obvious, yet this is where plenty of calculations fall apart.

Include these items when they are tied to the trade or transfer:
– maker/taker exchange fees, often quoted as a percentage of trade value
– fixed withdrawal fees charged by the exchange
– on-chain gas fees for the relevant transaction
– bridge fees for cross-chain movement
– slippage if your fill materially differed from your expected execution
– spread, when you are using market data to estimate true execution price rather than relying on a mid-market quote

Leave out these items unless your tax or accounting rules say otherwise:
– unrelated wallet top-ups
– hardware wallet purchase cost
– internet, electricity, or general home-office overhead
– losses from market movement on other coins
– staking rewards from a different asset
– sentimental cost, missed upside, or “I should have sold earlier”

A lot of generic advice tells people to “just use average price.” That is often too blunt. Average price can work for a rough portfolio view, but it can hide the actual effect of fees on each transaction. If you made ten small trades on a chain where each swap cost $4 to $40 in gas, the average can look tidy while the real result is dragged down by fixed costs. Nasty little tax trap, honestly.

One honest limitation: this method is good for calculating trade economics, but it is not the same as filing a tax return. Tax rules may require FIFO, specific identification, average cost, or another method, and some jurisdictions treat certain fees as adjustments to basis while others do not. I would not use a homemade spreadsheet as the final word if the records are messy or the amounts are large.

When does the standard calculation not apply?

The standard calculation needs adjustment whenever the transaction is not a plain buy-and-sell in one market. These cases change how fees and gas should be assigned, and ignoring that can distort the answer.

Swaps between tokens: A swap is a disposal of one asset and an acquisition of another — calculate the outgoing token’s profit or loss at fair market value when it left, then start a new cost basis for the incoming token. What to do: break the swap into two sides and assign gas to the side it supports.
Bridges across chains: Bridge transactions can involve more than one fee, and the asset may change form — treat each leg separately. What to do: record the bridge fee and any wrap or unwrap fee as distinct items.
Fees paid in crypto instead of fiat: A fee taken in the asset itself reduces your net proceeds or increases your basis, depending on the transaction. What to do: value the fee at the exact transaction time, using the same pricing source you use for the trade.
Airdrops and staking rewards: These are not purchase transactions, so the cost basis may be zero or the fair market value at receipt depending on local rules. What to do: do not force them into a standard buy calculation without checking the treatment first.
Partial fills and multiple fills in one order: One order can fill across several prices and times. What to do: calculate each fill separately or use the exchange’s weighted average fill report if it is complete.
Chain reorganizations or failed transactions: A failed transaction can still burn gas, but it may not create a disposal or acquisition. What to do: keep the fee record, but do not assume the whole trade executed.
Margin, futures, and perpetuals: These are not spot trades, and funding payments can alter the result. What to do: use the contract’s P&L method rather than spot arithmetic.

The rule is pretty simple: if the event changes ownership, asset form, or the market value recognized at the moment of transfer, do not squash it into one line. For large positions or frequent trading, a tax professional or accountant is the right person to map the method to your records. That is how people avoid overstating gains or burying losses. Worth the fee, in my view.

The mistakes people make, and what they cost

The biggest mistakes are not mathematical; they are classification errors. A spreadsheet can only be as correct as the events you put into it.

  1. Ignoring gas because it is “just network cost.”
    Consequence: profit looks bigger than it is, especially on chains with variable fees or on many small transactions.
    Correct alternative: record gas on the transaction that caused it and decide whether it belongs in basis, proceeds, or separate transfer cost.

  2. Using the quoted price instead of the filled price.
    Consequence: you miss spread and slippage, which can be material on thinly traded tokens.
    Correct alternative: use the actual execution price from the fill confirmation or trade history.

  3. Double-counting fees.
    Consequence: you understate profit or overstate loss. This happens when a fee is subtracted in both the net price and the expense column.
    Correct alternative: make one line for each fee and tie it to one event only.

  4. Combining multiple lots into one number without a cost method.
    Consequence: you lose the link between each purchase and each sale, and the result may not match FIFO or specific identification.
    Correct alternative: calculate lot by lot, then total the result.

  5. Treating swaps like ordinary sales.
    Consequence: the incoming token has no correct basis, and the outgoing token’s gain or loss is distorted.
    Correct alternative: split the swap into disposal and acquisition legs.

  6. Forgetting transaction dates and times.
    Consequence: you may use the wrong price source or the wrong tax year.
    Correct alternative: keep timestamps for every trade, transfer, and fee.

Leave a Reply

Your email address will not be published. Required fields are marked *