What is gas in Ethereum?
Gas measures how much computing work a transaction needs.1 Your fee is the gas used multiplied by a price per unit of gas, and it is always paid in ETH.2
A unit of work
Gas is the unit that measures the computing work an action on Ethereum needs.1 Each computing step has a set gas cost.3,2
Why charge for work at all? Without a fee, anyone could flood the network with spam, or run code that loops forever.1 Because every step costs money, spamming the network becomes expensive.2
Gwei and wei
Gas is paid in ETH. The price of one unit of gas is tiny, so it is quoted in gwei.1 One gwei is one billionth of an ETH, so 1 ETH equals 1,000,000,000 gwei.1,2
The smallest unit of ETH is the wei. One gwei is a billion wei.1
How much gas different jobs use
ethereum.org gives these typical amounts. Simple jobs use less gas than jobs that run a smart contract.2
| Job | Gas used |
|---|---|
| Sending ETH | 21,0002 |
| Sending a token (ERC-20) | 65,0002 |
| Transferring an NFT | 84,9042 |
| A swap on Uniswap | 184,5232 |
A plain ETH payment between two people's accounts needs exactly 21,000 gas.1,4 For contracts, the gas used differs from one contract to another.4
The fee formula
The fee is the units of gas used, multiplied by the base fee plus the priority fee.2 The next lesson explains those two prices.
ethereum.org's own example: an ETH payment uses 21,000 gas, the base fee is 10 gwei and the tip is 2 gwei. The fee is 21,000 × 12 = 252,000 gwei, or 0.000252 ETH.1
- Fee in gwei = gas used × (base fee + tip).
- Fee in ETH = fee in gwei ÷ 1,000,000,000.
- Fee in dollars = fee in ETH × the price of 1 ETH.
The quizzes use this method.
The gas limit
The gas limit is the most gas you are willing to use.1 A plain ETH payment needs a limit of 21,000. Contract calls need more.1
Gas you don't use comes back. Set a limit of 50,000 for an ETH payment, and it uses 21,000. You get the other 29,000 back.1
A limit that is too low can make a transaction fail.1 Lesson 5 explains what that costs.
Your wallet usually does this
Most wallets work out a recommended fee for you.1 They show the cost in a simpler way than the formula.2
- Gas and fees. ethereum.org developer docs, page updated 24 June 2026.
- Gas fees. ethereum.org, page updated 8 April 2025.
- Transactions. ethereum.org developer docs, page updated 7 October 2026.
- How To "Cancel" Ethereum Pending Transactions?. Etherscan Information Center, 23 July 2020, updated 21 June 2026.
General education built from the publicly available sources listed above. Not financial, legal, tax or investment advice. Naming a company, project or regulator is not an endorsement either way. Last checked 2026-10-22. Terms and disclaimer.