Beginner

What Is a Gas Fee?

By DappAtlas Editorial ·

On this page

A gas fee is the payment a blockchain network charges to process a transaction, paid in the network’s native token such as ETH. It depends on how much computation the transaction needs and how busy the network is.

Key takeaways

  • Gas measures the work a transaction needs; the fee is gas used times the gas price.
  • On Ethereum, fees have a base fee that is burned plus an optional priority tip (EIP-1559).
  • Gas prices are usually quoted in gwei, a billionth of an ETH.
  • Fees on L2 networks are usually far lower than on Ethereum.

How gas fees work

Every operation in a transaction costs a set amount of gas. You pay gas used × (base fee + priority fee). Since EIP-1559, the base fee is set by the network and burned, and the priority fee goes to the validator.[2]

The gas limit is the most gas you allow the transaction to use. A standard ETH transfer needs 21,000. If you set 50,000 for a transfer, 21,000 is used and 29,000 is returned. If you set 20,000, the transaction is rejected at validation before it enters a block, and no gas is charged.[1]

A transaction that runs out of gas during execution is different: the EVM reverts its changes, but all the gas you provided is consumed for the work already done.[1]

You also set maxFeePerGas, the most you will pay per unit of gas. You are refunded the difference between this cap and the base fee plus tip actually charged. Under EIP-1559 the tip you pay is min(max priority fee, max fee − base fee), so when the base fee rises close to your cap, the tip shrinks before the transaction becomes invalid.[2]

Why fees change

The base fee rises when blocks are fuller than the target and falls when they are emptier, so fees go up at busy times.[2]

The target is half the block gas limit, and a block can use up to twice the target. The change is linear: −12.5% for an empty block, 0% at the target, and +12.5% for a full block. ethereum.org's table with a 36 million gas limit shows the base fee going from 100 gwei to 112.5, then 126.6, then 142.4 gwei over consecutive full blocks.[1]

In EIP-1559 the adjustment is base fee × (gas used − target) ÷ target ÷ 8. With a base fee of 20 gwei, an 18 million target and a block that used 27 million: 20 × 9 ÷ 18 ÷ 8 = 1.25 gwei, so the next base fee is 21.25 gwei. These numbers are illustrative.[2]

Because the next base fee depends only on earlier blocks, a wallet can show a firm upper bound one block ahead: current base fee × 112.5%.[1]

Gas fees vs wallet fees

Gas goes to the network. MetaMask's swap guide splits a swap's cost into the quote rate, the network fee (gas) and a MetaMask fee of 0.875%; that last part is a separate charge added by the app.[4]

Worked example

All values below are illustrative. You send ETH with a gas limit of 21,000, a base fee of 15 gwei, a priority fee of 1.5 gwei and a max fee of 40 gwei.

Fee charged: 21,000 × (15 + 1.5) = 21,000 × 16.5 = 346,500 gwei = 0.0003465 ETH.[1]

Where it goes: 21,000 × 15 = 315,000 gwei (0.000315 ETH) is burned, and 21,000 × 1.5 = 31,500 gwei (0.0000315 ETH) goes to the validator as the tip.[1]

Refund: the wallet reserved 21,000 × 40 = 840,000 gwei. You get back 840,000 − 346,500 = 493,500 gwei, or 0.0004935 ETH.[2]

If the base fee jumped to 39.5 gwei before inclusion, the tip would be min(1.5, 40 − 39.5) = 0.5 gwei, and the total would be 21,000 × 40 = 840,000 gwei. Above 40 gwei the transaction waits until the base fee drops.[2]

How to check it yourself

A block explorer shows the gas used, the effective gas price and the total fee for any transaction. ethereum.org lists Etherscan and Blockscout among the gas price trackers you can check before sending.[1]

Developers can ask a node directly: eth_gasPrice returns an estimate in wei as a hex value. The example in the docs returns 0x1dfd14000, which is 8,049,999,872 wei, or about 8.05 gwei.[3]

The Bottom Line

Gas fees pay for the network’s work. Check the estimate in your wallet before you confirm, and use an L2 for small transactions.

Educational content, not financial advice.

Pros
  • Prevents spam by making each transaction cost something
Cons
  • Fees spike when the network is busy
  • Failed transactions still pay for the gas they used
Sources (4)
  1. [1] ethereum.org. “Gas and fees.” Accessed Sep 26, 2026.
  2. [2] Ethereum Improvement Proposals. “EIP-1559: Fee market change for ETH 1.0 chain.” Accessed Sep 26, 2026.
  3. [3] ethereum.org. “JSON-RPC API.” Accessed Sep 26, 2026.
  4. [4] MetaMask Help Center. “User guide: Swaps.” Accessed Sep 26, 2026.
Basics

Gas fee FAQ

What is gwei?

Gwei is a unit of ETH: 1 gwei is 0.000000001 ETH. Gas prices are quoted in gwei.

Why did my failed transaction still cost a fee?

The network did the work up to the point of failure, so the gas used is still charged.

What happens to gas I do not use?

It is returned. If you set a limit of 50,000 on a transfer that uses 21,000, the unused 29,000 is not charged.

Who receives the gas fee?

On Ethereum the base fee part is burned and removed from circulation. Only the priority fee (tip) goes to the validator.

ShareXLinkedInRedditEmailReport outdated info

Who made this page

Written by
DappAtlas Editorial

Editorial team

Compiles and updates the glossary and guides on DappAtlas. Facts come from primary sources: each project’s own pages, protocol docs and standards. No project pays to be mentioned.

Lists from DappAtlas Editorial
Fact check
Checked against 4 sources

Last check: Sep 26, 2026

A value we could not confirm on the project’s own pages is marked “Not verified” instead of estimated.

How we review

How this page works

Sources: ethereum.org, Ethereum Improvement Proposals, ethereum.org. Data as of Sep 26, 2026.

How we review

Not affiliated with any project listed. Educational content, not financial advice.