Wei

Wei is the smallest unit of ether (ETH), the native currency of Ethereum. One ether equals 10^18 (one quintillion) wei, and Ethereum's protocol records all ETH balances and transfers internally as whole numbers of wei.

The Ethereum Virtual Machine works only with whole numbers, not decimals. To handle fractions of a coin precisely, every ETH amount on-chain is stored and calculated in wei. Wallets and block explorers convert these figures into ETH so people can read them. The unit is named after Wei Dai, a computer scientist known for early digital cash proposals.

Most users rarely see wei directly, but it sits behind every transaction. Gas prices are usually quoted in gwei, which equals one billion (10^9) wei, because whole ETH figures for fees would be awkwardly small. Developers writing smart contracts in Solidity also work in wei, and many ERC-20 tokens copy the same 18-decimal design.

For example, sending 0.5 ETH means the network actually moves 500,000,000,000,000,000 wei. A simple transfer using 21,000 gas at an illustrative gas price of 20 gwei costs 420,000 gwei, or 420,000,000,000,000 wei, which is 0.00042 ETH.

The main risk is mixing up units. Some tools, contract interfaces and APIs expect raw wei values, so typing "1" where wei is expected sends a negligible amount, while entering a wei figure into an ETH field can request a vastly larger sum. Checking which unit a field uses, and reviewing the converted ETH amount before signing, helps avoid costly errors.

Related terms