Wei Definition: Wei is the smallest denomination of Ethereum — one wei is 0.000000000000000001 ETH (10^-18 ETH). Just as Bitcoin is divisible into satoshis (100 million satoshis per Bitcoin), Ethereum is divisible into wei. All gas fees, transaction values, and smart contract calculations on Ethereum are performed in wei to avoid floating-point arithmetic errors. Wei is named after Wei Dai, the inventor of b-money, an early precursor to Bitcoin.
What Is Wei?
Wei is Ethereum’s smallest unit of account. One Ethereum equals 1 quintillion wei (1,000,000,000,000,000,000 wei, or 10^18 wei). To understand the scale: if Bitcoin is divisible to 8 decimal places (satoshis), Ethereum is divisible to 18 decimal places (wei).
Why such extreme divisibility? Ethereum must support two functions: transfers of value (sending ETH) and smart contract state changes that track tiny amounts. Gas fees are microscopic portions of ETH — often a fraction of a cent. To avoid floating-point precision errors in code, Ethereum expresses all values internally in wei (integers), not decimals. This is why smart contracts work with wei, not ETH.
Units of Ethereum
Ethereum has a hierarchy of denominations, with wei at the bottom:
| Unit | Wei | ETH Equivalent |
|---|---|---|
| Wei | 1 | 0.000000000000000001 ETH |
| Kwei (Babbage) | 1,000 | 0.000000000000001 ETH |
| Mwei | 1,000,000 | 0.000000000001 ETH |
| Gwei (Nanoether) | 1,000,000,000 | 0.000000001 ETH |
| Szabo | 1,000,000,000,000 | 0.000001 ETH |
| Finney | 1,000,000,000,000,000 | 0.001 ETH |
| Ether | 1,000,000,000,000,000,000 | 1 ETH |
Why Wei Matters for Developers
In smart contract programming (Solidity), all state variables storing amounts are in wei. If you want a smart contract to accept 1 ETH as payment, you actually write code that accepts 1000000000000000000 wei. This prevents precision errors from decimal arithmetic.
Worked example: A smart contract sets a token price of 0.0001 ETH per token. In wei, this is 100000000000000 wei per token. If a user wants to buy 1,000 tokens, they must send 100000000000000000 wei (100 gwei × 1000 tokens). All calculations happen in integers (wei), avoiding the precision errors that would arise from decimal math.
Why Is Wei Important for Traders?
Wei is primarily a developer concern, but traders should understand it for two reasons:
First, gas fees are quoted in gwei (1 gwei = 1 billion wei = 0.000000001 ETH). When you see a transaction that costs “50 gwei,” you’re seeing a price in wei-derived units. Understanding this hierarchy helps you comprehend gas costs.
Second, when interacting with DeFi protocols on PrimeXBT or other platforms, you might encounter wei in smart contract data (reading balances, approvals, or contract states). Seeing a balance of “1234567890123456789 wei” instead of “1.234567890123456789 ETH” is confusing without understanding the conversion.
Key Takeaways
- Wei is the smallest unit of Ethereum — 1 wei = 10^-18 ETH, or one quintillionth of an Ethereum.
- Ethereum’s 18-decimal divisibility (wei) is much finer than Bitcoin’s 8-decimal divisibility (satoshis), enabling support for microscopic gas fees and precise smart contract calculations.
- All smart contracts perform calculations in wei (integers) rather than ETH (decimals) to avoid floating-point precision errors.
- Gas fees are commonly quoted in gwei (1 billion wei = 0.000000001 ETH) — understanding this conversion helps traders estimate transaction costs.
- Traders interacting with DeFi protocols or reading smart contract data may see balances in wei; dividing by 10^18 converts wei to ETH.