ETH to Wei Converter
Convert between ETH, Gwei, and Wei — the three units you encounter in Ethereum wallets, gas fees, and smart contracts. Enter any value and all conversions update instantly.
Ethereum Units: Wei, Gwei, and ETH Explained
Ethereum uses three denominations in everyday practice. Understanding when each is used avoids costly mistakes in smart contracts and transactions.
| Unit | Alternative Name | Wei Value | ETH Value | Used for |
|---|---|---|---|---|
| Wei | Wei | 1 | 10⁻¹⁸ ETH | Smart contract internals |
| Kwei | Babbage | 10³ | 10⁻¹⁵ ETH | Rarely used directly |
| Mwei | Lovelace | 10⁶ | 10⁻¹² ETH | Rarely used directly |
| Gwei | Shannon | 10⁹ | 10⁻⁹ ETH | Gas prices (wallets, EIP-1559) |
| Twei | Szabo | 10¹² | 10⁻⁶ ETH | Micro-ETH calculations |
| Pwei | Finney | 10¹⁵ | 10⁻³ ETH | Milli-ETH calculations |
| Ether | ETH | 10¹⁸ | 1 ETH | Prices, balances, transfers |
Why Wei Matters for Developers
In Solidity, all ETH values are represented as integers in Wei. The msg.value field,address.balance, and all token amounts use Wei. Using floating-point numbers for ETH amounts causes rounding errors — always store and calculate in Wei.
- Solidity:
msg.valueis always in Wei — divide by1e18to get ETH - ethers.js:
ethers.parseEther("1.0")returns1000000000000000000n(Wei as BigInt) - web3.js:
web3.utils.toWei("1", "ether")returns"1000000000000000000"
Frequently Asked Questions
What is Wei in Ethereum?
Wei is the smallest denomination of Ether (ETH). 1 ETH = 10^18 Wei (1,000,000,000,000,000,000 Wei). It is named after Wei Dai, the cryptographer who created b-money, a precursor to Bitcoin. All Ethereum transactions and smart contract operations are internally denominated in Wei.
What is Gwei and when do I use it?
Gwei (gigawei) equals 10^9 Wei, or 1,000,000,000 Wei. It is the standard unit for expressing Ethereum gas prices. When you set a gas price in MetaMask or any Ethereum wallet, you are setting it in Gwei. A typical transaction during normal network conditions costs 10–50 Gwei per unit of gas.
How is Ethereum gas calculated?
Gas cost = gas units × gas price (in Gwei). For example, a standard ETH transfer uses 21,000 gas units. At 20 Gwei gas price: 21,000 × 20 Gwei = 420,000 Gwei = 0.00042 ETH. Gas prices vary with network congestion — check current prices on Etherscan before sending.
Why does ETH have 18 decimal places?
ETH has 18 decimal places to allow microtransactions and precise smart contract accounting. This matches the common ERC-20 token standard (18 decimals), making ETH and tokens interoperable. The smallest unit, Wei, represents 0.000000000000000001 ETH — enough precision for any conceivable transaction size.
When should I use Wei vs Gwei in smart contracts?
Smart contract code always works in Wei internally. Use Wei when dealing with raw balances (e.g., msg.value in Solidity is always in Wei). Use Gwei only for human-readable gas price display. Never store ETH amounts as floating-point numbers in contracts — always use Wei as an integer to avoid rounding errors.