Ethereum Out of Gas vs Insufficient Gas: Why a Failed Transaction Can Still Cost ETH
An Ethereum transaction can fail because its gas limit was too low for the computation attempted, and a failure during execution can consume the provided gas even though contract state changes revert. That differs from a transaction rejected before inclusion for insufficient balance or an invalid base transaction. A large gas limit also does not mean the trader will automatically pay for every unused gas unit.
Ethereum.org’s gas documentation distinguishes intrinsic gas, execution gas, out-of-gas failure, unused gas and fee components. Its transaction lifecycle guide explains the treatment of unused gas. This guide concentrates on actual transaction costs, not the separate question of why a swap failed its minimum-output slippage check.
| Field | Value | Meaning |
|---|---|---|
| Gas limit | 100,000 units | Maximum permitted computation |
| Gas used on success | 60,000 | Unused 40,000 not fully charged |
| Effective gas price | 20 gwei | 20×10^-9 ETH per unit |
| Successful tx cost | 60,000×20 gwei | 0.0012 ETH |
| Out-of-gas at 100k | 100,000×20 gwei | 0.002 ETH cost model |
Values are illustrative unless directly attributed to cited provider documentation.
Gas limit is a cap on computational units, not always the fee paid
Gas measures EVM computation and state-operation work. A transaction sets a gas limit, but an included transaction that succeeds usually pays for gas actually used, not necessarily the whole limit. A simple native ETH transfer typically requires 21,000 gas under ordinary conditions, whereas contract interactions can use materially more. The effective gas price is measured in units such as gwei per gas.
The maximum fee parameters and actual used gas work together. A higher arbitrary gas limit should not be confused with a faster confirmation: priority fee and market base fee govern transaction inclusion incentives, while the gas limit controls maximum allowed execution work.
Worked 100,000 gas limit with 60,000 actually used
Suppose a fictional successful contract call sets 100,000 gas as its maximum, consumes 60,000 gas, and pays an effective fee of 20 gwei per gas. Since 1 gwei is 0.000000001 ETH, network fee is 60,000×20×10^-9 = 0.0012 ETH. The unused 40,000 gas units are not automatically charged as though used; the transaction accounts for unconsumed gas under protocol rules.
With the same effective fee and a simple 21,000 gas transfer, modelled network gas would be 0.00042 ETH, but the example assumes a stable effective fee and ordinary transfer. More complicated calls, rollup fees and special gas-refund mechanisms can add details.
Out-of-gas during execution and pre-validation rejection differ
If a contract execution exhausts the full 100,000 gas limit, it can revert its state changes but still consume the computational gas supplied, costing 100,000×20 gwei = 0.002 ETH under the simplified example. The user did not receive the intended token movement merely because the transaction was included in a block. A block receipt can show status failed/reverted and gas used.
By contrast, a basic ETH transfer with an intrinsic gas requirement of 21,000 may be invalid if submitted with only 20,000 gas limit. If a node rejects it before inclusion, no on-chain execution fee is charged for that rejected transaction. Do not call every wallet error ‘out of gas’ without checking whether there was an actual included receipt.
Why raising gas limit cannot fix every failed swap
A DEX swap can revert because the minimum accepted output amount is not met, token approval is missing, a deadline has passed, or the smart contract rejects the path. Those failures can occur even when ample gas was supplied. Raising the gas limit cannot force token liquidity to appear or a wrong contract to behave correctly, and it may increase the amount at stake if the transaction consumes much more gas before failure.
Read the failure reason, gas actually used, contract interaction and intended token transfers. Our DEX slippage and swap reversion guide covers market/contract conditions separately.
Base fee, priority fee and gas limit play different roles
Ethereum EIP-1559-style transactions specify a maximum total fee rate and a priority/tip rate, while the actual effective gas price depends on the base fee and accepted conditions. The base fee component is burned under protocol rules and the priority component generally compensates the proposer/validator. Multiplying the full max fee by the full gas limit is a maximum possible funding exposure calculation, not the actual final charge when execution uses less gas or effective fee is below the cap.
For accurate ledger accounting, retrieve gasUsed and effectiveGasPrice from the confirmed transaction receipt rather than estimating the fee from an initial wallet gas-limit preview alone.
Seven checks after an Ethereum transaction fails
- Find actual transaction hash and whether it was included in a block.
- Read receipt success/revert status and gasUsed.
- Check gasLimit and actual effectiveGasPrice, not only estimated max fees.
- Distinguish pre-inclusion rejection from execution out-of-gas.
- Verify actual token transfers rather than assuming a submitted call moved assets.
- Investigate slippage, approval or contract conditions separately from gas exhaustion.
- Keep cost in ETH and convert to GBP/USD at a documented relevant time for accounting.
A failed transaction may leave no intended asset transfer while still costing gas; careless retries can repeat the charge.
Three failed-looking gas scenarios should be classified separately
| Situation | On-chain inclusion? | Potential ETH charge |
|---|---|---|
| Intrinsic gas limit too low before acceptance | Normally rejected | No included transaction gas |
| Contract reverts after some operations | Yes, failure receipt | Gas used for executed work |
| Runs out of gas during execution | Yes, failure receipt | Can consume full execution gas limit |
Even with a failure receipt, the user must distinguish a genuine EVM out-of-gas event from a revert due to allowance, slippage or contract-specific assertions. Both can charge fees but require different remedies. Repeating the same trade after a revert without diagnosing the cause can incur repeated gas costs with no token transfer.
The wallet’s maximum fee preview is not a final statement
If a transaction has gas limit 100,000 and max fee 40 gwei, the wallet may reserve or display a maximum gas budget of up to 0.004 ETH. If 60,000 gas is actually consumed at 20 gwei effective price, the final fee is the smaller 0.0012 ETH. The calculation must use the confirmed receipt’s gasUsed and effectiveGasPrice, rather than deduct 0.004 and 0.0012 again as two independent charges. Rollups and alternative Ethereum-compatible chains may have extra data-fee mechanics, so always read the actual chain’s transaction receipt.
Why a wallet may show a larger temporary ETH requirement than the final fee
Before execution, wallet software may require the account to have enough native ETH for its estimated maximum gas exposure. A transaction can be rejected as insufficient funds even though its expected final used-gas cost would have been smaller, because the protocol must validate adequate resources before execution under the transaction parameters. After a successful included transaction, the balance reflects the actual charged effective gas and any value transferred, not necessarily the maximum advertised gas estimate. For precise statements, compare pre- and post-transaction ETH, transferred ETH value, and the receipt fee separately; an ERC-20 transfer can consume ETH network gas even when it moves no ETH as principal.
Frequently asked questions
Does setting 100,000 gas mean paying for 100,000 every time?
No. Successful execution normally pays actual consumed gas, with unused gas accounted for.
Can an out-of-gas revert still charge ETH?
Yes. Work performed before running out of gas can consume the provided gas.
What if a transaction never entered a block?
A pre-inclusion validation rejection does not generate an on-chain execution gas charge.
Does a higher gas limit always confirm faster?
No. Fee price and network conditions are different from computation limit.
Can extra gas fix a slippage error?
No. A swap’s min-output and market liquidity are separate from gas.
Primary sources
Important: This is educational, not personal financial advice. Digital-asset transfers and contracts can be irreversible; verify exact provider and network terms.
Stay Ahead of the Markets
Get market analysis, financial news and practical trading insights delivered straight to your inbox.