Wei ↔ Gwei ↔ ETH Converter
Convert Ethereum units between Wei, Gwei, and ETH with BigInt precision. Perfect for smart contract developers handling token values.
Unit Converter
Edit any field to auto-convert
Understanding Ethereum Units
Ethereum uses three primary units for transaction values and token amounts: Wei, Gwei, and ETH. Understanding the relationships between these units is essential for smart contract development, gas calculations, and token transfers.
Wei
The smallest unit of Ethereum
Used internally in smart contracts and blockchain state.
Gwei
Gas price unit
Standard for expressing gas prices and small transactions.
ETH
Human-readable unit
The primary unit seen on exchanges and in wallets.
Conversion Reference
| From | To | Formula |
|---|---|---|
| Wei | Gwei | ÷ 109 |
| Wei | ETH | ÷ 1018 |
| Gwei | Wei | × 109 |
| Gwei | ETH | ÷ 109 |
| ETH | Wei | × 1018 |
| ETH | Gwei | × 109 |
Solidity Example
How units are used in smart contracts:
// Token transfer: 1 ETH = 10^18 Wei
function transfer(address to, uint256 amount) {
// amount = 1000000000000000000 (1 ETH in Wei)
_balances[to] += amount;
}
// Gas price in Gwei
uint256 gasPrice = 25 gwei; // 25 * 10^9 Wei
// Working with decimals (18 decimals for USDC)
uint256 oneUsdc = 1e6; // 6 decimals = 1,000,000 units
// Common pattern: amount * 10^decimals
uint256 amount = 100 * 10**18; // 100 ETH in WeiWhy BigInt?
- •Handles 1018 without precision loss
- •No rounding errors in conversions
- •Matches smart contract integer math
- •Essential for large token amounts
Common Use Cases
- •Calculating gas fees (price in Gwei)
- •Token transfers (amount in Wei)
- •Wallet displays (convert to ETH)
- •Smart contract debugging
Decimal Handling
When entering ETH with decimals (e.g., 1.5 ETH), the converter properly handles the decimal point and converts to exact Wei amounts without precision loss. This is critical for accurate contract interactions and wallet operations.
