Gas and fees
Every operation costs a metered amount of computation, and you pay for it whether or not your transaction succeeds. This explains most of what confuses newcomers about costs.
Gas is the unit that measures computational work on Ethereum. Each operation has a fixed gas cost — a simple transfer is cheap, storing data is expensive, running a complex contract is more expensive again.
The three numbers
- Gas used. How much work the transaction actually performed. Determined by the code, not by you.
- Gas price. What you pay per unit, denominated in a tiny fraction of ETH called gwei. Determined by network demand.
- Gas limit. The maximum you authorise. A safety ceiling that stops a runaway program consuming your whole balance.
A simple transfer uses 21,000 gas. At a gas price of 20 gwei, the fee is 21,000 × 20 = 420,000 gwei = 0.00042 ETH. The same transfer when the network is congested at 200 gwei costs ten times as much — for identical work. The cost of a transaction depends on when you send it, not only on what it does.
The fee split
Since a 2021 change, the fee has two components. A base fee is set algorithmically from how full recent blocks were, and is destroyed rather than paid to anyone. A priority fee is an optional tip to the block producer for faster inclusion.
When network usage is heavy, more is destroyed than is issued to validators, and total supply falls. When usage is light, issuance exceeds burning and supply rises. Ethereum's net issuance is therefore a function of how much the network is used — a genuinely unusual monetary arrangement, and one reason ETH cannot be described with a fixed schedule the way Bitcoin's can.
The failure that surprises everyone
If a transaction runs out of gas, execution stops, all its effects are reverted — and the fee for the work done is still taken. You paid for computation that achieved nothing.
This is not a penalty. The network genuinely performed the work, and not charging for it would let anyone flood the system with deliberately failing transactions for free. It is correct design and it is a nasty first experience.
Why fees spike
Block space is fixed per block. When many people want to transact at once — a popular launch, a market crash triggering liquidations, an airdrop — competition for space raises the base fee sharply. Spikes are usually short and can be severe.
Reducing what you pay
- Use a layer 2. Rollups cost a small fraction of the main chain for the same operation. This is the answer for most ordinary activity.
- Wait. Fees vary through the day and week. Non-urgent transactions can simply be sent later.
- Batch. One transaction doing several things costs less than several transactions.
- Check before signing. Wallets estimate the fee before you confirm. If it looks wrong, it usually is.