In this track: Digital value and units
ETH, Gwei and Wei
The same amount of ether, measured with different sized rulers.
A metre and a centimetre measure the same thing. ETH and Wei work like that, with a much bigger gap between them.
1 ETH = 1000000000 Gwei = 1000000000000000000 Wei.
One asset, three useful units
ETH is the large unit. Wei is the smallest whole unit used for ether amounts. One ETH equals 1,000,000,000,000,000,000 Wei: that is 10 to the power of 18. One Gwei equals 1,000,000,000 Wei. Gwei is often used when discussing gas prices.
Why so many decimal places?
Software needs to represent tiny amounts exactly. Contracts usually work with whole numbers, so the value 0.5 ETH is written as 500000000000000000 Wei. You choose a unit for readability; changing the unit does not change the value.
Avoid the rounding trap
Ordinary JavaScript numbers cannot safely represent every large integer. Use exact integer arithmetic for Wei and treat the displayed decimal as text. Our Wei to ETH converter keeps every digit, including one Wei. It does not fetch a market price or convert ETH to dollars.
Tokens have their own decimals
A token’s smallest unit depends on that token’s contract. An ERC-20 token might use 6 decimals or 18, among other choices. Never assume a token amount uses ETH’s 18 decimals. The ABI lab shows raw token units rather than inventing a token price.
How much is 1 Gwei?
Gwei means a billion Wei. One ETH is a billion Gwei.
Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.