defi-blog

Why native currency decimals are 18 on EVM networks: wallet math

The native currency decimals value is usually 18 on EVM networks because Ethereum defined one ether as 10^18 wei, and wallets kept that scale. Chainlist shows the field beside each network's chain ID and RPC endpoints, making the setting visible when you add a chain. The Ethereum Virtual Machine stores balances as uint256 integers in the smallest unit; 18 tells a wallet how to display them.

Integer balances become readable coin amounts

The EVM uses integer arithmetic, so a tiny base unit represents fractions without floating-point balances. Ethereum's wei means the smallest denomination of ether: 1 ether equals 10^18 wei. That scale gives fine precision within a 256-bit unsigned integer.

  • Raw balance: the network's integer amount.
  • Decimals: the power of ten used to scale it.
  • Display balance: the wallet's coin amount.

Take 1500000000000000000 wei. Divide by 10^18 to display 1.5 ETH. The decimals field describes this conversion; a chain ID identifies the network, while a token contract defines its own decimals.

MetaMask's wallet_addEthereumChain request includes nativeCurrency with a name, symbol, and decimals. EIP-3085 allows a nonnegative value, but MetaMask accepts only 18 in this request. Entries therefore use 18 for the wallet flow even when the underlying coin has fewer native decimals. Before converting a raw balance, confirm the RPC's unit: the conversion relies on the number and the metadata using the same scale.

Hedera shows why. One HBAR contains 10^8 tinybars in native accounting. Its JSON-RPC relay reports HBAR balances in 18-decimal weibars for EVM wallets. A balance labeled in weibars is ready for division by 10^18; a balance labeled in tinybars needs 10^8. The RPC documentation or a known balance tells you which scale you have.

  • Wei sets Ethereum's 18-decimal scale.
  • RPC units determine how raw balances convert.
  • MetaMask requires 18 in network-add requests.

Can an EVM chain's native coin use different decimals?

Yes. Hedera's HBAR uses eight decimals natively; its Ethereum-facing relay converts values to 18-decimal units for wallets.

Where is the decimals value on a Chainlist entry?

Look in the native currency details beside its name and symbol. The value tells the wallet how to display native balances from the EVM-facing RPC.

More questions about units

What is gwei and how does it relate to wei?

One gwei equals 10^9 wei, or one billionth of an ETH. Gas prices commonly use gwei.

Why do USDC and USDT use 6 decimals?

Their issuers chose six decimal places for their token contracts, making one token equal to a million base units. Token precision is separate from native currency metadata.

How do I convert wei to ETH in JavaScript?

Pass the wei value to a big-integer-aware library's formatEther function. It divides by 10^18 without rounding through a JavaScript Number.

What is the maximum value of uint256?

It is 2^256 − 1, approximately 1.16 × 10^77, for an unsigned 256-bit integer.