Gas Fee

A gas fee is the transaction fee paid to a blockchain network, such as Ethereum, to have a transaction processed; it rises when the network is busy.

A gas fee is what you pay the network to process a transaction or smart contract call. On Ethereum it has two parts: a base fee set by the protocol and a tip that helps your transaction get picked. Fees rise when the network is busy.

Category
Cryptocurrency and Blockchain
Reading time
4 min
Also called
Gas, Network fee, Transaction fee
Updated

Gas fees in plain words

What you pay in gas has two parts: a base fee and an optional tip, called the priority fee.1

The base fee is the minimum for a valid transaction.1 It is burned, and validators keep only the tip.2

Offer too small a tip and validators may skip your transaction.1

How a gas fee is worked out

  1. Gas units

    Every action costs gas units; a simple ETH transfer uses 21,000.1

  2. Base fee

    Each block sets a base fee that works like a minimum price.1

  3. Add a tip

    The priority fee is added on top to attract validators.1

  4. Set a max fee

    Your wallet sets a maximum fee, and anything above base fee plus tip is refunded.1

  5. Multiply

    Fee = gas units × (base fee + tip).

  6. Watch demand

    The base fee can rise or fall by up to 12.5% per block depending on how full blocks are.1

Worked examples

Example 1 — Simple ETH transfer

0.000252 ETH

A hypothetical transfer uses 21,000 gas. Base fee 10 gwei, tip 2 gwei.

Example 1 — Simple ETH transfer — calculation
Price per gas10 + 2 = 12 gwei
Total21,000 × 12 = 252,000 gwei
In ETH252,000 gwei = 0.000252 ETH

The transfer size matches the 21,000 units of gas ethereum.org gives for an ETH transfer.1

Example 2 — Busy network

≈ +42% in 3 blocks

Hypothetically the base fee climbs from 10 gwei for 3 full blocks at the maximum step.

Example 2 — Busy network — calculation
Block 110 × 1.125 = 11.25 gwei
Block 211.25 × 1.125 ≈ 12.66 gwei
Block 312.66 × 1.125 ≈ 14.24 gwei

Each full block can push the base fee up by a maximum of 12.5%.1

Example 3 — Max fee refund

0.0015 ETH refunded

A hypothetical swap uses 150,000 gas with max fee 30 gwei; base fee is 18 gwei and tip 2 gwei.

Example 3 — Max fee refund — calculation
Paid150,000 × 20 = 3,000,000 gwei
Reserved150,000 × 30 = 4,500,000 gwei
Refunded4,500,000 − 3,000,000 = 1,500,000 gwei

The unused part of the maximum fee — above base fee plus tip — went back to the sender.1

Base fee vs priority fee

AspectBase feePriority fee (tip)
Who sets itThe protocolThe user or wallet
Who receives itNobody, it is burnedThe validator
PurposeMinimum price for block spaceWin priority in the block
Moves withBlock fullnessCompetition for inclusion

Where gas fees affect trading

Advantages and disadvantages

Advantages

  • Prevents spam by pricing block space.
  • Fee formula is transparent.
  • Max fee caps what you can pay.

Disadvantages

  • Costs spike when the network is busy.
  • Fixed costs hurt small trades.
  • Failed transactions still cost gas.
  • Gas units vary by contract, so estimates can be off.

Going deeper

Read as far as you need. Each level builds on the one before it.

Two parts

Beginner

Your fee is base fee plus tip, multiplied by gas used.1

Why the base fee is burned

Intermediate

Because the base fee is burned, validators gain nothing by pushing it up.2

Failed transactions

Advanced

Fees are charged whether a transaction succeeds or fails, so a reverted DeFi trade still costs money.3

Common mistakes

  1. Setting the tip to zero

    The transaction may sit unpicked.

  2. Ignoring gas on small trades

    Fees can exceed the profit.

  3. Retrying failed swaps blindly

    Each failure is charged.

  4. Confusing gas units and price

    Units measure work; gwei is the price.

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q1Gas used 50,000, base fee 20 gwei, tip 1 gwei. Total in gwei?
Q2Who receives the base fee?

Key points to remember

  1. Gas is the fee for network work.
  2. Fee = gas used × (base fee + tip).
  3. The base fee is burned; the tip goes to the validator.
  4. Busy blocks raise the base fee.
  5. Failed transactions still pay gas.

Frequently asked questions

What is gwei?

A small unit of ETH; one gwei is one billionth of an ETH.

Why are gas fees sometimes very high?

Demand for block space pushes the base fee up block by block.

Can I get gas back?

Unused max fee is refunded, but gas actually used is not, even on failure.

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. ethereum.org. Ethereum gas and fees: technical overview (opens in a new tab) Checked .
  2. Ethereum Improvement Proposals. EIP-1559: Fee market change for ETH 1.0 chain (opens in a new tab) Checked .
  3. European Securities and Markets Authority (ESMA). Decentralised Finance in the EU: Developments and risks (TRV, Oct 2023) (opens in a new tab) Checked .

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.