In this track: Digital value and units
beginner · 3 MIN READ

What are token decimals?

A token’s display scale tells you where to place the decimal point.

LET’S PICTURE IT

A game token could have a hundred small pieces per token or a million. The label does not tell you how many pieces the contract counts.

SEE IT FOR YOURSELF
The same native ether amount shown as ETH, Gwei and WeiETH1× 1 billionGWEI1000000000× 1 billionWEI1000000000000000000

1 ETH = 1000000000 Gwei = 1000000000000000000 Wei.

Same value · different units · native ether only

The contract counts raw units

For an ERC-20 token, an interface often uses decimals metadata to display the integer returned by balanceOf. If decimals is six, a raw balance of 1234567 is displayed as 1.234567 tokens.

Compare two scales

At eighteen decimals, that same raw number would be 0.000000000001234567 tokens. The raw integer has not changed. The display rule changed. This is why a decoder cannot infer a human token amount from uint256 alone.

Metadata is not universal proof

The ERC-20 decimals method is optional metadata in the specification. Implementations and interfaces need a policy for missing or unusual metadata. A declared decimal count also does not establish a token’s price, trustworthiness or supply policy.

Keep ETH conversion separate

Our Wei converter applies the native ETH scale only. For token amounts, obtain the correct network, token contract and decimal information before formatting. The ABI encoder deliberately shows raw amounts without inventing this missing context.

TURN UNDERSTANDING INTO PRACTICEOpen the ABI encoder →
QUICK CHECK · NO PRESSURE

A raw balance of 1234567 with six decimals displays as…

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.