Failed Transaction Cost Calculator

Estimate how much you'll lose if your Ethereum transaction reverts. The EVM charges for gas the contract actually used before failing — this calculator shows the floor and ceiling at your current gas price.

ETH price Last updated

Revert cost scenarios

Early revert
~10% of limit · validation failure
0.0006000 ETH
20,000 gas
Mid-execution revert
~50% of limit · slippage / oracle bounds
0.0030000 ETH
100,000 gas
Worst case
100% of limit · out-of-gas
0.0060000 ETH
200,000 gas

How EVM revert charging actually works

  • You pay for gas used, not gas limit. The contract burns gas as it executes opcodes. If it reverts before using the full limit, you're charged for what it consumed.
  • Out-of-gas = full limit charged. If the tx genuinely runs out of gas (consumed all the limit without completing), there's no leftover to refund. This is the worst case.
  • An immediate require() failure costs almost nothing. Reverts in the first few opcodes (input validation, balance checks) typically use under 30,000 gas regardless of the limit set.
  • DeFi calls often revert mid-way. Slippage failures, liquidation guards, and oracle bounds cause the contract to do real work before deciding to revert. Those are the painful ones — expect 30–70% of the gas limit consumed.
  • The gas refund logic is gone post-London. EIP-3529 (2021) eliminated most of the historical refund mechanism. Don't budget for refund offsets — they're negligible now.

What a failed transaction typically costs

How much a revert costs depends entirely on how far the contract got before failing. An early input check is cheap; a swap that reverts on slippage after doing all the math is not. Typical gas burned by failure type, with the bill at 30 Gwei and ETH ≈ $3,000 (the tool above uses your live gas):

Illustrative example only — assumes ETH = $3,000 and 30 Gwei. Use the live calculator above for current values.

Failure typeGas burnedCost @ 30 Gwei
Early require() revert (balance/allowance check)~25,000~$2.25
Failed Uniswap swap (slippage / price moved)~100,000~$9.00
Failed NFT mint (sold out / cap hit, late revert)~120,000~$10.80
Out-of-gas (full limit consumed)~200,000~$18.00

The worst cases — late-reverting swaps, sold-out mints, and out-of-gas — are exactly the ones that happen during congestion, when the gas price is also high. That's the double sting of a failed transaction: high gas and high gas-used, paid for zero result. Wallet simulation (Rabby, MetaMask) catches most reverts before you sign — use it during volatile windows.

Frequently asked questions

What happens to my gas if the transaction fails?

You pay for the gas units the EVM consumed before the revert. If a contract reverts on the first require() check, you pay maybe 21,000–30,000 gas. If it reverts after running most of the limit, you pay close to the full limit. The unused gas is refunded.

Why does a failed swap on Uniswap sometimes cost as much as a successful one?

Slippage and price-bound checks happen late in the execution path — after the contract has computed the swap. By the time the revert fires, most of the gas is gone.

Are there refunds for failed transactions?

EIP-3529 (London hardfork, 2021) eliminated most refund opcodes. Today you only get back the unused gas — there is no bonus refund for clearing storage or self-destructing contracts.

How do I avoid expensive failed transactions?

Three ways: (1) use wallet simulation (MetaMask, Rabby) which catches obvious reverts before signing, (2) keep gas limit close to the simulated estimate rather than padding it 2x, (3) verify slippage bounds for swaps so the tx doesn't revert on a moved price.

Does the gas price affect failed-tx cost differently?

No — the per-gas-unit charge is the same whether the tx succeeds or reverts. A high gas price hurts equally either way; only the gas USED varies between the two outcomes.

What is the typical gas used in a failed Uniswap swap?

Around 80,000–120,000 gas (50–70% of the typical 160k limit). The exact number depends on which check failed and how deep into the execution path the revert triggered.

Avoid the high-fee window entirely.

Set a target Gwei. Get notified when gas drops. Fewer failed txs because you're not gas-warring during congestion.