What is gwei?

The unit Ethereum fees are quoted in, equal to one billionth of one ETH.

Not yet verifiedHow we verify

3 min read

In this entry

The unit Ethereum fees are quoted in, equal to one billionth of one ETH.

Ether subdivides into 10^18 wei, and one gwei is 10^9 wei, which puts ordinary gas prices in readable whole numbers instead of long decimals (source: the Ethereum documentation). A wallet showing "12 gwei" means twelve gwei per unit of gas, so the cost of a transaction is that figure multiplied by the gas used. A plain ETH transfer uses 21,000 gas, which is why a simple send costs a fixed amount of gas at any given gwei price while a contract call does not.

You see gwei in every wallet confirmation screen, on gas trackers, and in the fee field of a block explorer. The common confusion is treating the gwei number as the price of the transaction. It is a rate, not a total. A quote of 12 gwei tells you nothing about cost until you know how much gas the transaction consumes, and a token swap can consume ten times the gas of a plain transfer at the same rate.

How it works

Since the fee market change introduced by EIP-1559, an Ethereum fee has two parts. The base fee is set by the protocol from how full recent blocks were and is burned rather than paid to anyone. The priority fee, sometimes called the tip, is what you add on top to compete for inclusion, and it goes to the block proposer. Both are quoted in gwei per gas.

Your wallet lets you set a maximum fee per gas and a maximum priority fee per gas. You are charged the base fee plus your priority fee, capped at your maximum, so setting a high maximum during a quiet period does not mean you pay it. What a high maximum does is protect you from a transaction stalling when the base fee rises between signing and inclusion.

Gas used depends on what the transaction does. A plain ETH transfer is fixed at 21,000 gas. A token transfer costs several times that, and a swap on a decentralized exchange more again, because each storage write and contract call has its own cost. Layer 2 networks quote fees the same way, with far smaller numbers.

Example

Illustrative arithmetic. You send ETH when the network shows a base fee of 10 gwei and you add a 2 gwei tip, so you pay 12 gwei per gas. The transfer uses the fixed 21,000 gas.

12 gwei times 21,000 gas equals 252,000 gwei, which is 0.000252 ETH. At an illustrative ETH price of $3,000, that is about $0.76. Now run the same rate against a swap that consumes 180,000 gas: 12 times 180,000 equals 2,160,000 gwei, or 0.00216 ETH, about $6.48. The gwei figure never changed. The gas did.

Why it matters when you buy

Network fees are separate from what an exchange charges, so a cheap trading fee can still leave you with an expensive withdrawal to your own wallet. Compare the two on the fee comparison, and if you plan to hold on a cheaper network, check what the chain pages report before you pick a withdrawal route. The gas fees guide walks through the same arithmetic in more detail.

  • gas: the unit of computational work being priced
  • base fee: the burned, protocol-set portion
  • priority fee: the tip that competes for inclusion
  • eip 1559: the change that created this fee structure
  • gas limit: the ceiling on gas a transaction may use
  • network fee: the general term across all chains

Questions

Why did my fee change after I signed?

You set a maximum, not a price. The base fee moves block by block, so you are charged the base fee current at inclusion plus your tip, up to the maximum you approved.

Is a low gwei setting always better?

It is cheaper and slower, and if the base fee rises above your maximum the transaction sits unconfirmed until it does not. For a time-sensitive action, the tip is what buys you a place in the next block.

Do layer 2 networks use gwei too?

Yes, and the arithmetic is identical. The numbers are much smaller because the network executes the transaction itself and only posts compressed data back to Ethereum.