In this track: Gas and execution fees
intermediate · 3 MIN READ

What happens to unused gas?

A gas limit is a permitted ceiling rather than a requirement to consume it.

LET’S PICTURE IT

Booking a maximum journey distance does not require the driver to travel unused kilometres.

SEE IT FOR YOURSELF
Calculate and split a manual execution feeStep 1 / 4
Calculate and split a manual execution feeGas used21,000A resource quantityGas used and gas limit are different quantitiesBase10 GweiEffective tip2 GweiTotal rate12 Gwei / gasAssumed total cap: 20 Gwei; no live prices are fetchedWork × rate21,000 × 12252,000 GweiExecution fee0.000252 ETHExact unit conversionThis calculation excludes blob and layer 2 data feesBase component0.00021 ETHBurned by protocolPriority component0.000042 ETHTo fee recipientComponents sum to the supplied 0.000252 ETH example

This example supplies twenty-one thousand gas used. It is a simple teaching input, not a live estimate of a contract call.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Execution can finish below its limit

A successful operation may consume fewer gas units than the transaction permits. Accounted gas consumption and effective price determine its execution-fee charge under the protocol rules.

Do not confuse unused allowance with refunds

Unused gas allowance is different from the protocol’s refund counter for particular state operations. Both can affect final accounting, but they arise through different mechanisms.

Maximum budget can overstate final cost

A wallet may show a maximum based on gas limit and fee cap. That figure is useful for affordability constraints, while the final receipt supplies actual consumption and effective price.

A failed operation needs precise context

Running out of gas and an explicit revert can have different remaining-gas behavior. Neither should be summarized as every failure refunds everything. Inspect the execution result and receipt rather than relying on the success label alone.

TURN UNDERSTANDING INTO PRACTICEOpen the Gas calculator →
QUICK CHECK · NO PRESSURE

Does a 100,000 gas limit force a successful 30,000-gas action to consume 100,000?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.