Library · Crypto, word by word · Inside Ethereum

What is a gas limit?

A gas limit is a cap on how much gas, Ethereum's unit of computational work, can be used. Each transaction has one, the most its sender lets it consume, and each block has one that caps the total work of all the transactions inside it.

What it means for you

If a transaction's limit is too low, it runs out of gas, its changes are reversed, and the whole limit is still charged: a failed transaction costs money and achieves nothing. If it succeeds, gas allowed but not used is returned, so a generous limit is not itself the cost.

How it works

The fee is the gas used times the price per gas (base fee plus tip). A plain ETH transfer needs 21,000 gas; contract calls need more, and wallets estimate the amount before signing. If execution hits the limit, the EVM reverts every change but all the gas provided is consumed. At block level, the protocol targets blocks using half the block gas limit and lets them grow to twice the target, adjusting the base fee to pull usage back toward the target.

An example

Say a swap is given a gas limit of 150,000, actually uses 120,000, and the price is 10 gwei per gas. You pay 1,200,000 gwei (0.0012 ETH) and the unused 30,000 gas is not charged. With a limit of 100,000 the swap would fail and still cost 1,000,000 gwei.

Sources: ethereum.org: Gas and fees, ethereum.org: Transactions · checked 4 October 2026

Often confused with

Gas limit vs Gas

Related words

GasGweiFailed transactionBase feeTransaction

Educational content, not financial advice. Written by hand and checked against the source named above. Something wrong? Tell us and we reply within two business days.