Gas Limit
The gas limit is the maximum amount of gas a transaction is allowed to consume. It caps how much computation, and therefore how much fee, a transaction can use, and if the work needs more gas than the limit, the transaction fails.
Gas, gas price and gas limit
On Ethereum and similar networks, every operation, from a simple transfer to a complex smart contract call, costs a set amount of gas, a unit that measures computational work. The fee you pay is the gas actually used multiplied by the price per unit of gas, which is the base fee plus any tip.
The gas limit is your safety cap. A simple ETH transfer always uses 21,000 gas, while a token swap or NFT mint can need several times more. Wallets estimate the needed amount and usually add a small buffer.
A worked example
Say you call a contract with a gas limit of 100,000, and the call actually uses 60,000. With a base fee of 20 gwei and a 2 gwei tip, you pay 60,000 times 22 gwei, which is 1,320,000 gwei or 0.00132 ETH. The unused 40,000 gas costs nothing. If the call had needed 120,000 gas, it would run out at 100,000, every change would be reverted, and you would still pay for the 100,000 gas used.
Why the limit exists
Smart contracts can contain loops or bugs that would otherwise run indefinitely. The gas limit guarantees that every transaction stops at a known maximum cost, protecting both you and the network. It also lets you see the worst case before signing.
The block gas limit, and common mistakes
Separately, each block has a block gas limit that caps the total gas of all transactions in it, set by the network and adjustable over time by validators. It determines how much activity fits into one block and is a key parameter in Ethereum's scaling debate.
Setting your own limit too low by hand is a common way to waste fees on a failed transaction. Setting it extremely high costs nothing extra, but an unusually high estimate from your wallet can be a warning sign that a contract is doing more than you expect, so it is worth checking what you are signing.
Ask Coach about it
Coach is the AI on AtenaCrypto. It explains crypto with live market data, in plain words.
Why did my Ethereum transaction fail with an out-of-gas error, and how do I avoid paying for failed transactions?Ask Coach →
Frequently asked questions
Do I pay the full gas limit?
No. You pay only for the gas actually used. The limit is a maximum, not a price.
What does out of gas mean?
The transaction needed more gas than its limit, so it stopped and all its changes were undone. The gas consumed up to that point is still charged.
Should I change the gas limit my wallet suggests?
Usually not. Wallet estimates are based on simulating the transaction; change it only if you understand why a different value is needed.
Related terms
Learn it step by step
AC Learning explains these ideas in interactive lessons — the first eight sections are free.
Open AC Learning → Create a free accountAll glossary terms · Educational reference only — not investment, legal, tax or financial advice.