What it means

Every transaction carries a gas limit, the maximum amount of computation it may consume. If execution reaches that ceiling before finishing, it stops and every state change is rolled back, as though it never ran.

The gas is not refunded, because validators executed the instructions up to that point. MetaMask documents this directly: execution consumes gas even when the intended operation does not succeed. You paid for work, not for a result.

Why it happens

01

The gas limit was set manually and set too low

If you edited the limit, or a tool set a fixed one, it may simply be below what the operation needs. A plain native transfer costs 21,000 gas; a token transfer costs more; a contract interaction can cost considerably more.

02

The estimate was made against different state

Wallets estimate by simulating the transaction against the current state of the chain. If that state changes before your transaction executes — a pool is drained, a parameter changes, someone else transacts first — the real cost can exceed the estimate.

03

The operation branched into a more expensive path

A contract can take different paths depending on conditions at execution time. A path that writes more data, or touches more storage slots, costs more than the one that was simulated.

04

A first-time interaction costs more

Writing to a storage slot that was previously empty costs more than updating one that already held a value. A first transfer to an address, or a first interaction with a contract, can therefore cost more than a later identical-looking one.

How to fix it

  1. Open the failed transaction on a block explorer and check the gas used against the gas limit. If they are equal or nearly so, the limit was the constraint.
  2. Retry with a higher gas limit. Raising the limit does not raise the price you pay if the transaction uses less — unused gas is not charged.
  3. If your wallet estimated the limit, let it estimate again rather than reusing the old value; conditions have changed.
  4. If the same operation fails repeatedly at a generous limit, the problem is more likely a revert than a limit. See execution reverted.

How to avoid it

Let the wallet estimate the gas limit unless you have a specific reason not to, and accept a limit above the estimate rather than trimming it. The limit is a ceiling, not a cost: setting it higher than needed does not make the transaction more expensive, while setting it too low guarantees a wasted fee.

Frequently asked

Why was I charged for a transaction that did nothing?

Because the computation was performed. Validators executed your transaction up to the point where it ran out of allowance, and the fee pays for that execution. The state changes were rolled back, but the work was not undone.

Does raising the gas limit cost more?

Not in itself. You pay for gas actually used, not the limit. A higher limit only means you must hold enough to cover the worst case while the transaction is pending.

Is out of gas the same as insufficient funds for gas?

No. Insufficient funds means the transaction was never sent, and costs nothing. Out of gas means it was sent, executed, and failed partway, and the fee is consumed.

PUT IT TO USEWork through a gas scenario

Sources & further reading

  1. MetaMask: why you paid gas for a failed transaction

    Execution consumes gas even when the intended operation does not succeed.

  2. Ethereum: gas and fees

    Gas units, limits and the fee calculation.

  3. Etherscan: reasons for failed transactions

    How a reverted transaction is displayed and what state is rolled back.

  4. Ethereum: transactions

    Transaction fields including nonce, gas limit and fee caps.

Sources checked on 18 September 2026. Network features and platform support can change; check the relevant provider before acting.

AI-assisted editorial content; no independent expert review is claimed. Error behaviour varies between wallets, networks and client versions. This is educational information, not investment advice. Read our editorial policy.