Wei

The smallest atomic unit.

1 Ether = 1018 Wei. Gas costs returned by eth_gasPrice are in Wei as hex. Converting the raw hex gives you the exact Wei amount without rounding.

Gwei

The gas price standard.

EIP-1559 base fees come back as hex integers in Wei. Divide by 109 to get the Gwei figure you see on gas trackers.

Ether

The account balance unit.

eth_getBalance returns hex Wei. Divide by 1018 to get the ETH figure a wallet shows the user.

Why Ethereum chose hexadecimal.

JSON transport

JSON has no native 256-bit integer type. Ethereum represents all integers as "0x..." hex strings so they can be transmitted precisely without floating-point loss.

Compact encoding

One hex digit = 4 bits. A 32-byte hash (256 bits) becomes 64 hex characters — versus 78 decimal digits or 256 binary characters.

EVM alignment

The EVM operates on 32-byte (256-bit) words. Hex maps directly — one 64-char string = one EVM word.

Common RPC hex fields.

RPC MethodFieldMeaningUnit
eth_blockNumberresultCurrent block heightblock
eth_getBalanceresultAccount ETH balanceWei
eth_gasPriceresultCurrent gas priceWei
eth_getTransactionByHashvalueETH transferredWei
eth_getTransactionByHashgasGas limitgas units
eth_getTransactionReceiptgasUsedGas actually usedgas units