Gas

Gas is the unit that measures the computational work needed to process a transaction or run a smart contract on Ethereum and other EVM-compatible blockchains. The gas fee is that amount multiplied by a price per unit, usually quoted in gwei.

Every operation the Ethereum Virtual Machine performs has a set gas cost. A simple transfer uses little gas, while a complex smart contract interaction, such as a token swap, uses more. The fee equals the gas used multiplied by the price per unit of gas. Gas prices are usually quoted in gwei, one billionth of an ETH. Under EIP-1559, the price has two parts: a base fee set by the network, which rises and falls with demand and is burned, and an optional priority fee, or tip, paid to the validator.

Gas fees depend on how busy the network is and how complex the transaction is, not on how much value is being moved. If a transaction offers too little, validators are less likely to include it, so it may execute late or not at all. Wallets also set a gas limit, the maximum number of gas units a transaction is allowed to use.

For example, a plain ETH transfer uses 21,000 gas. At a hypothetical price of 10 gwei per unit, the fee is 210,000 gwei, or 0.00021 ETH.

A common misconception is that a failed transaction costs nothing. If it reverts or runs out of gas, the gas already used is still charged. Fees are paid in the network's native coin, so a wallet holding only tokens cannot move them without ETH on Ethereum. Layer 2 networks are often used to reduce these costs.

Learn more

Related terms