GlossaryMetric
Gas Fee: What It Is and How It Works
A gas fee is the payment, in a network's native token, needed to execute a transaction or smart-contract operation on Ethereum and similar blockchains, priced per unit of computation (gas). It pays validators, prevents spam, and on Ethereum is partly burned.
By COINOTAG Research DeskLast updated Sources
Why gas fees exist
Gas works like fuel: the more complex a transaction, the more gas it burns. Ethereum's designers built the model for two reasons. First, it protects the network from denial-of-service (spam) attacks: because every computational step has a price, flooding the chain with endless loops or junk transactions is expensive. Second, it makes those who use the network's shared resources, computation, storage and bandwidth, pay for them.
The payment goes to whoever includes transactions in blocks: miners before Ethereum moved to proof of stake, validators today. Since EIP-1559, the base-fee part is burned instead.
Fees move with demand. During busy periods, such as a popular NFT mint or a sharp market move, competition for block space pushes the gas price up; in quiet hours it falls.
How gas fees work
Every operation a transaction triggers on Ethereum, from moving ETH to running a smart contract, costs a fixed amount of gas. Gas measures computation, not money. A simple ETH transfer uses 21,000 gas; a token swap or an NFT mint uses more because it runs more code.
The price of each unit of gas is quoted in gwei, where 1 gwei = 0.000000001 ETH. Since the EIP-1559 fee reform, that price has two parts:
- Base fee: set by the protocol for each block, rising when blocks are fuller than the target and falling when they are emptier. The base fee is burned, removing that ETH from circulation.
- Priority fee (tip): an optional extra paid to the validator to include the transaction sooner.
Total fee = gas used × (base fee + priority fee)
Wallets estimate this automatically. Users also set a gas limit, the maximum gas the transaction may use; if it runs out, the transaction fails but the gas already consumed is still paid.
The Ethereum Virtual Machine charges a fixed amount of gas for each operation (opcode). Since EIP-2929, reading a storage slot for the first time in a transaction (a "cold" SLOAD) costs 2,100 gas, and writing a value to a storage slot that was zero (SSTORE) costs 20,000 gas. Storage is expensive because every node has to keep that data permanently.
Worked example (in ETH, hypothetical): a token swap on a DEX might use around 150,000–200,000 gas. With a base fee of 30 gwei and a tip of 1 gwei, a 200,000-gas swap costs 200,000 × 31 gwei = 6,200,000 gwei, or 0.0062 ETH. The same swap on a layer-2 network usually costs a small fraction of that.
Failed transactions still pay. If a transaction runs out of gas or the contract reverts, its changes are undone, but the gas used up to that point is still charged. That is why wallets warn before sending a transaction that is likely to fail.
How Ethereum's fee model evolved
In Ethereum's early years, users simply bid a gas price and validators picked the highest bids, which made fees unpredictable during busy periods. EIP-1559, activated with the London upgrade in 2021, introduced the burned base fee and the separate tip, making fee estimates more predictable.
The Dencun upgrade on 13 March 2024 added a separate, cheaper data space called blobs (EIP-4844) for layer-2 rollups, which sharply reduced the cost of using many layer-2 networks.
The fee history tracks Ethereum's usage waves. In 2017 the ICO boom and, late that year, the CryptoKitties game congested the network and first pushed fees sharply higher. During the 2020 "DeFi summer" and the 2021 NFT boom, demand for block space rose so far that even a simple swap on mainnet became expensive for many users. Those periods accelerated both EIP-1559 and the move to layer 2.
- 5 August 2021: EIP-1559 went live with the London upgrade.
- 13 March 2024: Dencun added EIP-4844 blob space.
Because the base fee is burned, the ETH burned in busy periods can exceed new issuance, so ETH's supply can shrink during those periods.
Why gas fees change and how to pay less
Fees rise when many people want to use the chain at the same time, for example during market swings, popular NFT mints or token launches, because the base fee climbs block by block as demand stays high.
Ways to reduce costs:
- use a layer-2 network such as Arbitrum or Optimism, where fees are typically much lower;
- send non-urgent transactions when the network is quieter and set a lower tip;
- batch actions where an app allows it.
Other blockchains have their own fee models. Bitcoin charges fees by transaction size in bytes, while Solana uses a small base fee plus optional priority fees. "Gas" is mainly an Ethereum and EVM term, and live gas prices change constantly, so this page does not quote them.
Key terms
- Gwei: the unit for gas prices; 1 gwei = 10⁻⁹ ETH.
- Gas limit: the maximum gas a transaction may use. Blocks also have a gas limit, which caps how much computation fits in one block.
- Base fee: set by the protocol from block fullness, and burned.
- Priority fee (tip): the optional payment to the validator.
- Mempool: the pool of pending transactions not yet in a block; low-fee transactions wait there longer.
- Gas optimization: contract design patterns that reduce the gas a function uses, lowering costs for every user.
Frequently Asked Questions
What is a gas fee in crypto?
It is the fee paid to process a transaction or smart-contract action on Ethereum or a similar blockchain, calculated from the gas used and the gas price.
What is gwei?
Gwei is the unit used to quote gas prices: one gwei equals 0.000000001 ETH.
Why are gas fees so high sometimes?
When demand for block space is high, the base fee rises automatically from block to block, and users add larger tips to get included sooner.
Do I pay gas if my transaction fails?
Yes. A failed transaction still consumes the gas used up to the point of failure, because validators did the work.

