Why do failed Ethereum transactions still cost gas?
The fee pays for computing work, and that work is done whether or not the transaction succeeds.1,2 A failed transaction undoes its changes, but the gas it used is still charged.1
Success or failure
Once a transaction is in a block, the fee is paid whether it succeeds or fails.1 Each transaction's receipt records a status code: 1 for success, 0 for failure.3 Explorers such as Etherscan show this as the transaction's status.4
What "failed" means
When a transaction in a block fails, its changes are undone. The ETH or tokens it tried to send stay where they were.1,2 But the fee is still taken, because the computing work really happened.2
Two ways to fail, two different bills
Running out of gas. A transaction can use up all its gas before it finishes. Then everything is undone, but all the gas you provided is used up.1 In other words, you pay for your whole gas limit.1,5
A revert. A contract can also stop on purpose, with an instruction called REVERT, and give a reason. This undoes the changes without using up all the gas.5 You pay only for the gas used up to that point. The rest of your gas limit comes back.5,6
- Out of gas: fee = gas limit × (base fee + tip).
- Revert: fee = gas used before the revert × (base fee + tip).
Failing before it starts
Some transactions never reach a block. Say you set a gas limit of 20,000 for a plain ETH payment, which needs 21,000. The transaction is rejected before it gets into a block, and no gas is used.1
Blob fees are not refunded either
Layer 2 networks can post data to Ethereum in "blobs". The blob fee is taken before the transaction runs, burned, and not refunded if the transaction fails.7
Avoiding a failure
After an out-of-gas failure, Etherscan says to send the transaction again with a suitable gas limit.2 Wallets usually suggest a limit. You can also look at similar transactions that went through before.2 Etherscan also suggests keeping a little extra ETH in your address for fees.2
- Gas and fees. ethereum.org developer docs, page updated 24 June 2026.
- What is Gas Fee?. Etherscan Information Center (Kaven Choi), 26 November 2019, updated 21 June 2026.
- EIP-658: Embedding transaction status code in receipts. Ethereum Improvement Proposals (Nick Johnson), created 30 June 2017, status Final.
- Transaction details page for a token transfer, 6 December 2021 (tx 0x4f5ef12b…9de4). Etherscan, transaction of 6 December 2021, page read 22 October 2026.
- EIP-140: REVERT instruction. Ethereum Improvement Proposals (Alex Beregszaszi, Nikolai Mushegian), created 6 February 2017, status Final.
- EIP-1559: Fee market change for ETH 1.0 chain. Ethereum Improvement Proposals (Vitalik Buterin and others), created 13 April 2019, status Final.
- EIP-4844: Shard Blob Transactions. Ethereum Improvement Proposals (Vitalik Buterin and others), created 25 February 2022, status Final.
General education built from the publicly available sources listed above. Not financial, legal, tax or investment advice. Naming a company, project or regulator is not an endorsement either way. Last checked 2026-10-22. Terms and disclaimer.