Quiz Entry - updated: 2026.07.30
What are the Ether units Wei, Gwei, and Ether, and how do they relate?
Wei is the smallest indivisible unit; 1 Ether = 10^18 wei, and 1 Gwei = 10^9 wei (a billion wei). Solidity does all value arithmetic in wei.
| Unit | In wei | Note |
|---|---|---|
| Wei | 1 | Smallest unit, no fractions below it |
| Gwei | 1,000,000,000 (10^9) | Common unit for gas prices |
| Ether | 1,000,000,000,000,000,000 (10^18) | The headline unit |
Because Solidity has no decimals, everything is counted in whole wei. So "1 Ether" in code is 1e18 (i.e. 1 * 10**18) wei, and msg.value is always expressed in wei. Requiring at least 1 whole Ether looks like require(msg.value >= 1e18). Keeping units straight — wei vs Ether — is essential to avoid off-by-10^18 bugs.
Go deeper:
ethereum.org: intro to Ether — the wei/gwei/ether denominations explained.
Solidity docs: ether units — the
wei/gwei/ethersuffixes you can write in code.