In one sentence
Gas is the unit Ethereum uses to measure how much computational work a transaction needs; the fee a sender pays is the gas used multiplied by a fee per unit of gas.
How it works
Every operation the Ethereum Virtual Machine can perform has a fixed gas cost written into the protocol. Adding two numbers costs 3 gas. Writing a new value into a contract's permanent storage costs 20,000 gas, because every node has to keep it. A plain transfer of ether between two accounts costs 21,000 gas in total.
The sender sets a gas limit: the most gas the transaction may use. If the work runs out of gas before it finishes, execution stops and all its changes are undone — but the gas already used is still charged, because nodes really did the work. Each block also has a gas limit, which caps the total work in one block and keeps nodes from being overloaded.
Since the London upgrade of 5 August 2021, which introduced EIP-1559, the fee per unit of gas has two parts. The base fee is set by the protocol: it rises when blocks are fuller than a target and falls when they are emptier, by at most 12.5% from one block to the next, and it is destroyed rather than paid to anyone. The priority fee is an optional tip that goes to the validator who includes the transaction.
Gas also closes a loophole: because every step costs something, a program cannot loop forever and stall the network.
A simple example
A token transfer uses 50,000 gas. At that moment the base fee is 10 gwei per unit of gas (a gwei is one billionth of an ether), and the sender adds a tip of 1 gwei. The fee is 50,000 × 11 = 550,000 gwei. Of that, 500,000 gwei is destroyed as base fee and 50,000 gwei goes to the validator.
Common misconception
Misconception: Gas is a separate token you need to get before using Ethereum.
In fact: Gas is a unit of measurement, like kilowatt-hours for electricity. Fees are paid in the network's own unit, ether, at a rate expressed per unit of gas.
Where you meet it
- Fee screens in wallet software before a transaction is signed.
- Block explorers, which show "gas used" and "gas limit".
- Layer-2 networks, most of which use the same idea.
Related cards
Sources
This card explains a technical concept for general education. It is not a recommendation to acquire, sell or hold any crypto-asset, and it is not financial advice.