Wei, Gwei and ETH: quick answers
- 1 ETH = 1,000,000,000 Gwei = 1,000,000,000,000,000,000 Wei (10^18 Wei).
- 1 Gwei = 0.000000001 ETH = 1,000,000,000 Wei (10^9 Wei).
- 1 Wei = 0.000000000000000001 ETH (10^-18 ETH) = 0.000000001 Gwei.
Wei is the smallest unit of Ether and the one smart contracts and RPC responses use. Gwei (also called Shannon) is the unit gas prices are quoted in. Type a value into any field above and every other unit updates, or start from a preset such as 1 ETH or 30 Gwei.
ETH, Gwei and Wei conversion table
ETH Gwei Wei 0.001 1,000,000 1,000,000,000,000,000 0.01 10,000,000 10,000,000,000,000,000 0.1 100,000,000 100,000,000,000,000,000 1 1,000,000,000 1,000,000,000,000,000,000 10 10,000,000,000 10,000,000,000,000,000,000
How to convert Wei to ETH and Gwei to ETH
- Wei to ETH: divide by 10^18, which moves the decimal point 18 places left.
2500000000000000Wei is 0.0025 ETH. - Gwei to ETH: divide by 10^9, nine places left.
30Gwei is 0.00000003 ETH. - ETH to Wei: multiply by 10^18. 0.05 ETH is
50000000000000000Wei. - ETH to Gwei: multiply by 10^9. 0.05 ETH is 50,000,000 Gwei.
Doing this with ordinary JavaScript numbers loses precision, because values above 2^53 can't be stored exactly and 1 ETH in Wei is far larger. This converter works on the digits with BigInt, so every result is exact, and it rejects more decimal places than a unit can hold (more than 18 for ETH, 9 for Gwei) instead of rounding them.
Converting gas to ETH
A transaction's maximum fee is its gas limit multiplied by the gas price. Gas prices are in Gwei, so multiply and then convert the result to ETH:
21,000 gas × 20 Gwei = 420,000 Gwei 420,000 Gwei = 0.00042 ETH = 420,000,000,000,000 Wei
A plain ETH transfer uses 21,000 gas; token transfers and swaps use more, and the estimator above has presets for an ETH transfer, an ERC-20 transfer and a token swap. Since EIP-1559 you pay the gas actually used times the base fee plus your priority fee, capped by your max gas price, so the real fee is often lower than this maximum.