What Are Ethereum Gas Fees?
Gas is the unit used to measure how much computational work an Ethereum transaction does. Gas fees are what you pay (in ETH) to have that work executed and recorded by the network.
In one formula:
fee (ETH) = gas used × (base fee + priority tip)- gas used — how much work your transaction took (set by the code being executed).
- base fee — the protocol-set price per gas unit, burned.
- priority tip — optional bribe to the validator who includes you.
That's it. Everything else — gas limit, gwei, EIP-1559, blobs — is a refinement of this formula.
For background on the terms, see gas, gas fee and EIP-1559 in the glossary.
Why Do Gas Fees Exist?
If transactions were free, attackers could spam the network with infinite computation. Gas is the anti-spam meter: every operation has a fixed cost, so wasting block space costs real money.
Different operations cost different amounts:
| Operation | Approx. gas |
|---|---|
| Simple ETH transfer | 21,000 |
| ERC-20 transfer | 50,000–65,000 |
| Uniswap swap | 120,000–200,000 |
| NFT mint | 80,000–250,000 |
| Complex DeFi (lending, bridges) | 200,000–600,000+ |
Multiply by the gas price (base fee + tip) and you have your fee.
EIP-1559 — How Base Fee and Tips Work
Before EIP-1559 (2021), Ethereum used a first-price auction: you guessed a gas price and hoped. It often overpaid.
EIP-1559 replaced that with:
- Base fee — set by the protocol per block. Goes up when blocks are full, down when empty. Burned (removed from circulation).
- Priority tip — the part validators actually earn. You can set it low if you don't mind waiting.
Net result:
- More predictable fees.
- ETH issuance is sometimes net-deflationary under heavy use, because the base fee burn exceeds new issuance.
What Is "Gwei" and "Gas Limit"?
- Gwei = 0.000000001 ETH (a billionth). Gas prices are displayed in gwei because they're tiny.
- Gas limit = the maximum amount of gas you allow your transaction to consume. If actual gas exceeds this, the transaction reverts but you still pay for the work done.
For standard transactions, your wallet sets a sane gas limit automatically. For complex DeFi, set it slightly above the estimate to avoid out-of-gas reverts.
Why Are Gas Fees Sometimes So High?
Three reasons fees spike:
- Demand for block space outpaces supply (NFT mints, airdrops, market crashes).
- High-value MEV transactions willing to pay huge tips push base fee up.
- Complex contracts (bridges, DeFi aggregators) inherently cost more gas.
There is no "gas price negotiation" — you simply set what you're willing to pay. Lower tip = longer wait or non-inclusion.
The Real Fix: Layer 2
The simplest way to pay less gas is to stop using Ethereum mainnet for most things. A Layer 2 (Arbitrum, Base, Optimism, zkSync, Linea, Starknet) batches transactions off-chain and posts compressed data back to Ethereum.
Typical 2026 fees:
| Network | ETH transfer | Uniswap swap |
|---|---|---|
| Ethereum mainnet | $1–10+ | $5–40+ |
| Arbitrum | $0.02–0.10 | $0.10–0.50 |
| Base | $0.01–0.05 | $0.05–0.30 |
| zkSync Era | $0.05–0.20 | $0.20–1.00 |
| Polygon zkEVM | $0.02–0.10 | $0.10–0.50 |
L2s inherit Ethereum's security via rollups. Most apps you use day-to-day should be on an L2 unless you have a specific reason to settle on L1.
What Are "Blobs" (EIP-4844)?
In 2024 Ethereum added blob transactions — a new transaction type that lets rollups post temporary "blob" data far more cheaply than calldata. The result was a step-change in L2 fees: most rollup costs dropped 5–20×.
You don't interact with blobs directly. Just know that's why L2 fees got dramatically cheaper.
How to Actually Pay Less Gas
Practical checklist for users:
- Use an L2 for swaps, NFTs, daily DeFi.
- Bridge once, then live on the L2.
- Batch transactions when possible (some wallets / Safe).
- Set lower priority tips if you're not in a rush — check Etherscan Gas Tracker for current "safe slow" tip.
- Skip mainnet during peak hours (US trading hours, big mints).
- Approve max once for tokens you'll use a lot — saves repeated approve gas.
- Use aggregators wisely. 1inch / Matcha can save fees on big swaps; for small swaps the routing gas eats the saving.
- Watch wallet warnings. Wallets like Rabby flag overly high gas suggestions.
How to Pay Less Gas as a Developer
If you're a builder, gas optimization is its own discipline. The big wins:
- Pack state variables into the same storage slot.
- Use
uint256(cheaper than smaller uints in many ops). - Cache storage reads in memory inside loops.
- Use
uncheckedfor arithmetic you've proven safe. - Use
immutableandconstantaggressively. - Use
calldatainstead ofmemoryfor read-only function args. - Use events instead of storing data you only need off-chain.
- Bench with
forge test --gas-report.
Read more in our Solidity smart contracts guide.
Gas FAQ
What is a "gas war"?
When many people compete to land transactions in the same block (e.g. a hot NFT mint), driving priority tips up massively.
Why did my transaction fail and still cost gas?
Reverted transactions still consume the gas used up to the revert. You only avoid fees if it fails before inclusion (rare).
Can I cancel a stuck transaction?
Yes — submit a new transaction from the same address with the same nonce and a higher gas price. Most wallets expose this as "Speed up" or "Cancel".
Is gas the same on every EVM chain?
The mechanics are similar, but each chain has its own gas price, block size, and may have non-EIP-1559 fee markets. Always check explorer-recommended fees.
Do L2s have base fees too?
Yes — most modern L2s implement an EIP-1559-style fee market locally, plus a smaller L1 data-posting cost.
Next Step
Gas fees are one of those things that suddenly make sense once you've actually sent a transaction on testnet and watched the fee components in a wallet. The Bitcoin Proof of Work course builds the underlying intuition (fees → block space → consensus), and our Solidity guide teaches you how to write contracts that don't waste gas. Browse all courses for more.