Wei

The smallest unit of ether: one ether equals 10^18 wei.

What is Wei?

Wei is the smallest denomination of ether, the native currency of Ethereum. One ether equals 1,000,000,000,000,000,000 wei, which is 10^18, a one followed by eighteen zeros. Wei is to ether roughly what the satoshi is to bitcoin: the base unit that cannot be divided further.

How it works

Ethereum does not use decimal fractions internally. Balances, payments and fees are stored and calculated as whole numbers of wei. Whole numbers avoid the rounding errors that fractions can cause in software, which matters when code handles money. Wallets convert the figures into ether or gwei for display.

Units

Gwei is the unit normally used to quote gas prices. Some other named units exist, but in practice only wei, gwei and ether are in common use.

The name

The unit is named after Wei Dai, a computer scientist who in 1998 described "b-money", an early proposal for anonymous, distributed electronic cash. His work is cited in the Bitcoin whitepaper.

Example

A developer writing a smart contract that charges 0.05 ether must express the amount in wei: 50,000,000,000,000,000. A block explorer shows a transaction with a gas price of 15 gwei; internally this is 15,000,000,000 wei per unit of gas.

Why it matters

Most users never have to enter amounts in wei, but the unit appears in block explorers, in contract code and in the raw data of transactions. Knowing it helps in reading those figures and in understanding why token amounts often appear as very long numbers. Many ERC-20 tokens follow the same convention and use 18 decimal places.

Common misunderstandings

Wei is not a separate cryptocurrency and cannot be traded on its own. Mixing up units is a classic programming error: a value intended as ether but interpreted as wei is smaller by a factor of 10^18.

Related terms