na.to.
📚 All keywords › 🪙 Cryptocurrency, starting from the structure › Ethereum Gas Fees: How the Base Fee and Priority Fee Are Set
KO EN
⛽

Ethereum Gas Fees: How the Base Fee and Priority Fee Are Set

How Ethereum gas fees come from gas used, the base fee and the priority fee, why they rise when the network is busy, and why failed transactions cost a fee too.

📚 Cryptocurrency, starting from the structure · 50/53· ⏱ About 7min read ·Information updated 2026-10-23
📋 Key facts6
Meaning
A fee paid in ETH: the work a transaction needs (gas) times a unit price
Formula
Gas used × (base fee + priority fee)
Unit
1 gwei is one-billionth of an ETH
Base fee
Set automatically each block and burned (since the London upgrade, August 2021)
Failed transactions
The fee is paid whether the transaction succeeds or fails
Basis
Official Ethereum documentation, as of October 2026

What gas fees are and why they matter

When you send coins, swap tokens or run a smart contract on Ethereum, you pay a fee to the network. Ethereum measures the computation this work needs in a unit called gas, and sets the fee by multiplying it by a price per unit of gas, which is why people call it a gas fee. A gas fee is not the trading fee an exchange charges when you buy or sell; it is the cost of recording a transaction on the blockchain. If you use a personal wallet or DeFi, you pay it yourself every time you transact, and the fee an exchange charges when you withdraw coins also reflects this kind of network cost. Once you understand the structure, it becomes clear why fees are sometimes high and sometimes low, and why even a failed transaction costs money.

Gas, its units, and why you need ETH

Gas is a unit for measuring computation, and different kinds of transactions use different amounts of it. According to the official Ethereum documentation, the simplest transfer, sending ETH from one address to another, needs 21,000 gas. Sending a token or swapping on a decentralized exchange also runs contract code, so it uses more gas than that. Gas prices are usually shown in gwei, and 1 gwei is one-billionth of an ETH. Because gas fees must be paid in ETH, if your wallet holds only stablecoins and no ETH, you usually cannot even send those stablecoins.

  • Gas: the amount of computation a transaction needs
  • Simple ETH transfer: 21,000 gas
  • Token transfers and swaps: more, because contract code runs
  • 1 gwei = 0.000000001 ETH
  • Fees are paid only in ETH

The base fee and the priority fee

Since the London upgrade on August 5, 2021, which introduced EIP-1559, the Ethereum gas price has had two parts. The base fee is set automatically by the protocol for each block, and once paid it is burned, so it goes to no one. The priority fee is a kind of tip, received by the validator that includes the transaction in a block. The fee is therefore calculated as 'gas used × (base fee + priority fee)'. Assuming, as in the official documentation's example, a base fee of 10 gwei and a priority fee of 2 gwei, a simple transfer costs 21,000 × 12 = 252,000 gwei, or 0.000252 ETH. How much that is in your home currency depends on the ETH price at the time.

  • Base fee: set by the protocol and burned
  • Priority fee: a tip that goes to the validator
  • Fee = gas used × (base + priority)
  • Assumption: 21,000 × 12 gwei = 0.000252 ETH

Why fees rise when the network is busy

There is a limit on how much gas one block can hold, and the target is half of that limit. If the previous block was fuller than the target, the base fee for the next block rises; if it was emptier, the base fee falls, and it can change by at most 12.5% per block. When transactions pile up because of a popular token launch or a sharp market move, blocks stay full and the base fee rises block after block. Costs grow further as people bid up the priority fee to get into the same block first. Conversely, the base fee falls when the network is quiet, so for transactions that are not urgent, simply waiting can change the cost. The block limit itself has also changed over time through validator agreement and upgrades, so it is better not to memorize it as a fixed number.

The max fee and the money you get back

When you send a transaction from a wallet, you set both a gas limit, the most gas this transaction may use, and a max fee, the most you are willing to pay per unit of gas. Most wallets fill these in automatically based on the base fee and a recommended priority fee. You actually pay only that block's base fee plus the priority fee, and you get back the difference from the max fee as well as any gas you did not use. However, if the amount you offer is too low, the transaction may be processed late or not at all. A transaction that sits as 'pending' in your wallet for a long time is usually in this situation.

  • Gas limit: the most gas this transaction may use
  • Max fee: the most you will pay per unit of gas
  • The difference and unused gas are refunded
  • Set it too low and it may wait long or never go through

Why failed transactions still cost a fee

A gas fee pays for work, not for results. If a transaction is reverted because a condition is not met while a contract runs, or stops because it runs out of gas, all state changes are cancelled, but you do not get back the cost of the computation the network has already done. The official Ethereum documentation also explains that the fee is paid whether the transaction succeeds or fails. If you set the gas limit too low, the gas runs out partway through, and you pay the fee while the transaction does not happen. Failures on a decentralized exchange when the price moves outside your allowed range work the same way, so retrying the same transaction many times while the network is busy piles up fees for failures.

Layer 2 and exchange withdrawal fees

Layer 2 networks, which process transactions outside Ethereum and record the results on Ethereum in batches, generally charge much less per transaction. The Dencun upgrade on March 13, 2024 lowered the cost for layer 2 networks to post data to Ethereum. Even when addresses look the same, however, a layer 2 is a different network from Ethereum, so when you withdraw from an exchange you must check that the receiving side supports that network. Exchange withdrawal fees are amounts that each exchange sets and announces per coin and network, so they are not the same as the actual gas fee at that moment. Even for the same token, the fee and whether it arrives at all depend on which network you send it over.

Summary and cautions

A gas fee is 'gas used × (base fee + priority fee)', and the base fee rises and falls automatically with how full blocks are, and is burned. You usually need ETH even to send tokens, and failed transactions still cost a fee. Dates and rules follow the official Ethereum documentation as of October 2026, and the numbers in the example are assumptions to aid understanding. The gas fee and network fee entry in this site's crypto and stock glossary is also worth reading alongside this. Before sending, check the estimated fee your wallet shows and the receiving network. This article does not recommend any coin or service and is not investment advice.

🧰 Related tools

Check it live

🔗 More in this category

🌍 Search the web for this

Each button runs this keyword on that search engine