Mcap -- BTC -- ETH -- SOL -- BNB -- XRP -- F&G -- View Market
Loading prices…

Wei

The smallest unit of Ether — one quintillionth (10^-18) of an ETH. The base unit Ethereum tracks internally.

Ethereum 4 min read

Wei is the smallest unit of ether. One ether equals 10¹⁸ wei — a quintillion, or a billion billion. Ethereum’s protocol internally tracks all balances, gas prices, and transaction amounts in wei rather than in ether, because working with integers is simpler and safer for a financial system than working with floating-point decimals. The conversion to ether is purely a display convention; at the database level, your 1 ETH balance is actually stored as 1,000,000,000,000,000,000 wei.

The unit is named after Wei Dai, a computer scientist who described “b-money”, an early proposal for a decentralised digital currency, in 1998. Wei Dai’s work was one of the acknowledged inspirations for Bitcoin (Satoshi cited him in early correspondence), and Ethereum’s decision to name the base unit after him was an explicit tribute to the prehistory of cryptocurrency design. The other Ethereum subunits — gwei (giga-wei), szabo, finney — are similarly named after cryptographers and computer scientists who contributed to the ideas that eventually became Ethereum.

Why the Scale

A quintillion wei per ether seems like overkill, and at first glance it is. Bitcoin gets by with a hundred million satoshis per BTC, which is already small enough to handle any practical micro-payment. Why does Ethereum need a unit that is ten billion times smaller?

The answer is that Ethereum’s gas pricing requires much finer granularity than Bitcoin’s fee model does. Gas prices are quoted in gwei (10⁹ wei, or 10⁻⁹ ETH), and the arithmetic of gas consumption × gas price can produce fractional gwei values that need to be representable exactly. Having wei as the base unit means that any rounding happens at a scale much smaller than any value anyone cares about, and no valid Ethereum operation ever runs into precision issues from the integer representation.

The practical meaning of wei for ordinary users is approximately zero. You will essentially never type a value in wei, quote a price in wei, or think about wei as a unit outside of very specific technical contexts. Wallets display balances in ETH and gas prices in gwei; wei is an internal implementation detail that most users never see.

Where Wei Shows Up

The places wei becomes visible are mostly technical:

Smart contract code. When you write Solidity, you specify value amounts in wei by default. msg.value in a payable function is in wei. The transfer(address, uint256 amount) function of an ERC-20 token takes the amount as a raw integer, and the meaning of that integer depends on the token’s decimals convention (most ERC-20 tokens use 18 decimals to match ether’s precision, so 1 whole token equals 10¹⁸ base units, exactly parallel to wei). Solidity has syntactic sugar for expressing larger units: 1 ether compiles to 1000000000000000000, 1 gwei compiles to 1000000000, and so on.

JSON-RPC responses. When you query an Ethereum node via the standard JSON-RPC interface for an account balance, the response comes back as a hex string representing the number of wei. "0xde0b6b3a7640000" is the hex representation of 10¹⁸, which is 1 ETH. Wallets and block explorers convert this to human-readable form before displaying it, but at the wire level, wei is the unit being transmitted.

Debugging and block explorers. Etherscan and similar block explorers sometimes show wei-precision values when you drill into low-level transaction details, especially for gas-related calculations where the last few digits matter. If you are trying to reconcile a gas accounting issue, you may end up looking at numbers at wei precision, and the tooling will let you do so even if it is not the default view.

The Other Subunits

Beyond wei and gwei, Ethereum has several other named subunits that mostly exist as historical curiosities:

  • kwei or babbage: 10³ wei (named after Charles Babbage)
  • mwei or lovelace: 10⁶ wei (named after Ada Lovelace, and also the unit used on Cardano for a slightly different reason)
  • gwei or shannon: 10⁹ wei (named after Claude Shannon)
  • szabo: 10¹² wei (named after Nick Szabo)
  • finney: 10¹⁵ wei (named after Hal Finney)
  • ether: 10¹⁸ wei

Of these, only wei, gwei, and ether are actually used in practice. The others show up in historical Solidity documentation and as curiosities, but you will almost never see them in the wild. If someone asks you to price something in szabo, they are either showing off or they are lost in a 2016 blog post. For everyone else, the three-unit ladder (wei, gwei, ether) is all you need.