What Is Gas in Ethereum?
Ethereum gas measures the computing work a transaction needs. Learn how gas, gwei, base fees and tips work, why fees change, and how to avoid overpaying.
Gas in Ethereum is the unit that measures how much computing work a transaction or smart contract action requires, and the gas fee is what you pay, in ETH, for that work. Your total fee equals the gas used multiplied by the price per unit of gas, which rises and falls with demand for space in each block.
Gas exists for two reasons. It pays validators for processing transactions, and it stops anyone from clogging the network with endless computations, because every step costs money. If you have ever been surprised by a high fee, or had a transaction stuck or failed, understanding gas will make those moments much easier to manage.
How Ethereum Gas Works
Every operation the Ethereum Virtual Machine performs, such as adding numbers, storing data or calling another contract, has a fixed gas cost. A transaction's gas used is the total of all those operations.
Some typical patterns:
| Action | Relative gas use |
|---|---|
| Sending ETH to another wallet | 21,000 gas (fixed) |
| Sending an ERC-20 token | More than an ETH transfer, because a contract runs |
| Approving a token for an app | Similar to a token transfer |
| Swapping on a decentralized exchange | Considerably more, as several contracts interact |
| Minting an NFT or complex DeFi actions | Often the highest |
The amount of gas an action needs is fairly predictable. What changes from minute to minute is the price you pay for each unit.
Gwei: the price per unit
Gas prices are quoted in gwei. One gwei is 0.000000001 ETH. If a transfer uses 21,000 gas and the total price is 10 gwei per gas, the fee is 210,000 gwei, or 0.00021 ETH.
The Fee Formula After EIP-1559
In 2021, Ethereum's London upgrade introduced EIP-1559, which changed how fees are set. Each transaction now includes:
- Base fee: set automatically by the protocol for each block, based on how full the previous block was. It is burned (permanently removed from supply), not paid to validators.
- Priority fee (tip): an extra amount you add to encourage validators to include your transaction sooner.
- Max fee: the most you are willing to pay per unit of gas. If the base fee plus tip is lower, you are refunded the difference.
- Gas limit: the maximum gas you allow the transaction to use, protecting you from runaway costs.
Your fee = gas used × (base fee + priority fee), capped by your max fee.
Blocks have a target size. When demand pushes blocks above the target, the base fee rises for the next block; when blocks are emptier, it falls. That is why fees climb during busy moments such as popular token launches or sharp market moves.
A worked fee example
Suppose you send a token transfer that uses 50,000 gas. The base fee is 8 gwei and you add a 1 gwei tip, for 9 gwei per unit of gas. Your fee is 50,000 × 9 = 450,000 gwei, or 0.00045 ETH. Of that, 400,000 gwei is burned and 50,000 gwei goes to the validator. If you had set a max fee of 20 gwei, you still only pay 9 gwei per unit, because the max fee is a ceiling, not the price.
Why Gas Fees Spike
- Market volatility. Traders rush to buy, sell or avoid liquidation.
- Popular mints and launches. Many users compete for the same block space.
- Complex transactions. DeFi actions use more gas than simple transfers.
- Bots. Arbitrage and liquidation bots bid high tips to get priority.
Gas on Layer-2 Networks
Layer-2 networks (rollups) process transactions off the main chain and post compressed data back to Ethereum. Because many transactions share the cost of that one post, fees per transaction are usually much lower. A 2024 upgrade introduced a cheaper type of data storage for rollups called blobs, which further reduced layer-2 costs.
On most major layer-2 networks, gas is still paid in ETH, so you need a small amount of ETH on that network. Our guides to rollups and using layer-2 networks to pay lower fees explain how to get started.
How to Avoid Overpaying for Gas
- 1Check fees before you transact. Our guide on checking gas fees before you transact lists simple ways to do this.
- 2Use your wallet's suggested fee unless you understand why you need a different one.
- 3Wait for quieter periods if your transaction isn't urgent.
- 4Avoid unnecessary approvals, and batch actions where an app supports it.
- 5Keep enough ETH for fees. Without ETH, you can't move your tokens on Ethereum.
- 6Use layer-2 networks for small or frequent transactions.
Gas-Related Scams and Mistakes
- "Gas fee" requests from strangers. Scammers ask victims to send ETH to "pay gas" for a prize, airdrop or withdrawal. Real services deduct fees automatically.
- Setting the gas limit too low. The transaction runs out of gas, fails, and you still pay for the work done.
- Overpaying tips during panic. High tips rarely help if your max fee is already sufficient.
- Stuck transactions. If a transaction is pending for a long time, you can often replace it with a higher fee. See our guide on speeding up or cancelling a stuck Ethereum transaction.
Bottom line
Ethereum gas is the meter that prices computing work on the network. You pay gas used multiplied by the base fee plus your tip, and the base fee moves with demand. Check fees before transacting, keep some ETH for gas, use layer-2 networks for smaller transactions, and never pay "gas" to a stranger who promises you something in return. You can follow the current Ethereum price to understand what fees cost in your own currency.
Частые вопросы
What is gas in Ethereum in simple terms?
Gas is the unit that measures how much computing work an Ethereum transaction requires. Every action, from sending ETH to running a smart contract, uses a certain amount of gas. You pay for that gas in ETH, and the price per unit of gas changes with how busy the network is.
Why do I pay gas if my transaction failed?
Validators still did the computing work up to the point the transaction failed, so the gas used is charged. A failed transaction does not move your tokens, but the fee is not refunded. Wallet simulations and checking the transaction details before signing help reduce failed transactions.
What is gwei?
Gwei is a small denomination of ETH used to express gas prices. One gwei equals one billionth of an ETH. Saying a base fee is 10 gwei means each unit of gas costs 10 billionths of an ETH, which is easier to read than a long decimal.
How can I pay lower gas fees on Ethereum?
Transact when the network is less busy, avoid unnecessary approvals, let your wallet estimate fees instead of setting very high tips, and consider using a layer-2 network for frequent or small transactions. Layer-2 networks batch many transactions together and usually cost far less per transaction.
