Home / Wiki / W / Wei

Wei

Cryptocurrency and Digital AssetsUpdated 05 Nov 2026

Wei is the smallest unit of ether (ETH), the native currency of Ethereum. One ether is divided into 101810^{18} wei, or one quintillion. Inside the protocol every account balance, every transfer and every fee is stored as a whole number of wei; "ether" and its other units are simply ways of writing those integers in a form people can read.

Wei matters mostly to developers, wallets and block explorers. Ordinary users see ETH amounts with a few decimal places, and gas prices in gwei (one billion wei). The unit is named after Wei Dai, the computer engineer who in 1998 described b-money, an early proposal for anonymous digital cash that the Satoshi Nakamoto Bitcoin white paper later cited.

01

Wei in plain terms

A wei is to ether what a single grain of sand is to a bucket. Nobody pays for coffee in grains, but the bucket is only ever counted grain by grain, so there is never any doubt about how much sand is in it.

Banks do something similar with money: an account showing $10.50 is usually stored as 1,050 cents, because whole numbers are easier for computers to add and compare exactly. Ethereum takes the same approach, only with an extremely small "cent", so that tiny fractions of an ether can still be counted precisely.

02

The ether unit table

The official Ethereum documentation names only wei and gwei. Developer libraries also recognise a set of older names, several of them honouring pioneers of computing and cryptography:

UnitValue in weiValue in etherNamed after
wei110−1810^{-18}Wei Dai, author of b-money
kwei (babbage)10310^{3}10−1510^{-15}Charles Babbage
mwei (lovelace)10610^{6}10−1210^{-12}Ada Lovelace
gwei (shannon)10910^{9}10−910^{-9}Claude Shannon
szabo (microether)101210^{12}10−610^{-6}Nick Szabo
finney (milliether)101510^{15}10−310^{-3}Hal Finney
ether101810^{18}1(base unit for users)

In practice only wei, gwei and ether are in everyday use. Nick Szabo, honoured by the szabo, is credited with the idea of the smart contract, and Hal Finney received the first Bitcoin transaction from Satoshi Nakamoto in January 2009.

03

Converting between wei and ether

The conversion is a fixed power of ten:

Amount in ETH=Amount in wei1018\text{Amount in ETH} = \frac{\text{Amount in wei}}{10^{18}}
  • Amount in wei\text{Amount in wei} is the integer stored on chain.
  • 101810^{18} is the number of wei in one ether.

Example: a balance stored as 2,500,000,000,000,000,000 wei is 2.5×1018÷1018=2.52.5 \times 10^{18} \div 10^{18} = 2.5 ETH. In the other direction, 0.000462 ETH (a typical simple transfer fee at 22 gwei) is 0.000462×1018=462,000,000,000,0000.000462 \times 10^{18} = 462{,}000{,}000{,}000{,}000 wei, or 462,000 gwei.

04

Why contracts count in wei

The Ethereum Virtual Machine (EVM) has no decimal or floating-point numbers. It works with 256-bit unsigned integers, which can hold numbers far larger than the entire ether supply expressed in wei. Programs written in Solidity therefore receive msg.value and read balances in wei, and the language offers suffixes such as 1 ether and 1 gwei that the compiler turns into the matching integer.

Counting in whole numbers avoids the rounding errors that floating-point arithmetic would introduce, which matters when a contract splits payments, calculates interest in decentralized finance (DeFi) or settles a trade. The same idea carried over to tokens: the ERC-20 standard stores token balances as integers and publishes a decimals value (18 for most tokens, 6 for USDC) so wallets know where to place the decimal point.

Common errors in wallets and integrations come from mixing up these scales, for example treating a wei amount as ETH or applying 18 decimals to a 6-decimal stablecoin. Payment teams connecting Ethereum to accounting systems usually keep amounts as integers in the smallest unit end to end and convert only for display. Spreadsheets and many databases cannot hold an 18-decimal figure exactly, so wei amounts are often stored as text or as large-integer types to avoid silent rounding.

05

Wei compared with other base units

Bitcoin's smallest unit, the satoshi, is 10−810^{-8} BTC, so Bitcoin has eight decimal places against Ether's eighteen. The finer division in Ethereum reflects its role as "fuel" for computation: gas prices can be set in fractions of a gwei, and very small amounts can change hands inside contracts. Other chains chose their own scales, for example the lamport of Solana (10−910^{-9} SOL).

From a monetary point of view, wei is a denomination of ether rather than a separate asset; it is the unit of account the protocol uses internally. A wei is far too small to have any practical spending value on its own. Its tiny size is also why gas fees and gas limits are expressed in gwei rather than wei, which would produce unreadably long numbers.

Last updated 05 Nov 2026