What is gwei?

The unit gas prices are quoted in, and how it relates to ETH.

Updated

Short answer

A gwei is one billionth of an ether, or 0.000000001 ETH. Gas prices are quoted in gwei because the numbers are unreadable written out in whole ether, and the name is short for gigawei.

Ether is divisible down to a unit called wei, and one ether is 1018 wei. Gwei sits in the middle: one gwei is a billion wei, and a billion gwei is one ether. The name is short for gigawei, the same giga- prefix as in gigabyte.

The denominations

Ether denominations and their values
1 weismallest unit0.000000000000000001 ETH
1 gwei1,000,000,000 wei0.000000001 ETH
1 ETH1,000,000,000 gwei1,000,000,000,000,000,000 wei

Wei is what the protocol actually counts in. Every fee, balance and transfer amount is an integer number of wei, which is why the numbers you see in a block explorer's raw view are so long. Gwei and ether are display conventions on top of that.

Why gas prices use gwei

Because the alternative is unreadable. A gas price written in ether comes out as 0.000000012, and a price written in wei comes out as 12,000,000,000. Neither is a number anyone can compare at a glance. The same price in gwei is 12.

Turning a gwei price into a fee

Multiply the gas your transaction uses by the price per gas, then divide by a billion to get ether. A plain ETH transfer uses 21,000 gas, so at a price of 10 gwei:

21,000 × 10 gwei = 210,000 gwei = 0.00021 ETH

At 1 gwei the same transfer costs 0.000021 ETH. At 100 gwei it costs 0.0021 ETH. The gas figure stays put and the price does all the moving, which is the reason fees swing the way they do.

You will also see fees quoted with decimals, like 0.34 gwei. That is fine. Gwei is only a label for a wei amount, and wei goes nine decimal places further down.

Tips especially. On a quiet chain the tip that gets a transaction included is often a few hundredths of a gwei, so a price like 0.023 is a normal number rather than a rounding error.