mainnet 11:54:29 UTC
/index/ /tools/ /04 token-decimals
live

Token
decimals.

Standard
ERC-20
name · symbol · decimals · supply
Networks
11
EVM mainnets
Reads
eth_call
batched, public RPC
Auth
None
no key, no signing
/04ERC-20 LOOKUP · ETHEREUM
↺ reset
/reference — common decimal counts
tokendecimalsnote
ETH (native)18protocol-level, not an ERC-20
most ERC-20s18DAI, UNI, LINK, AAVE, …
USDC, USDT6stablecoins follow USD precision
WBTC8matches native BTC satoshi precision
GUSD2Gemini USD — penny precision
/notes
01
Why decimals matter.
A balance of 1000000 on USDC means 1 USDC. The same integer on DAI (18 decimals) means 0.000000000001 DAI. Off-by-one on the decimals field is the most common cause of misread amounts.
02
Reads are batched.
All four ERC-20 fields fetch in a single JSON-RPC batch (with a sequential fallback for endpoints that reject batches). One round-trip per chain switch, no connection prompt, no API key.
03
Bytes32 fallback.
Pre-EIP-20 tokens like MakerDAO's MKR return name and symbol as fixed bytes32 instead of dynamic strings. The decoder detects this case and trims trailing zeros so the output matches what wallets show.
/faq
01

Why do tokens have different decimal places?

ERC-20 contracts store balances as integers (uint256). The decimals() field tells interfaces where to place the decimal point. Most tokens use 18 decimals (matching ETH); USDC and USDT use 6; WBTC uses 8 to match Bitcoin.

02

What is total supply in raw units?

totalSupply() returns the integer quantity of indivisible units. To get the human-readable supply, divide by 10^decimals. Some tokens cap supply (deflationary or fixed); others mint and burn dynamically.

03

Can a contract lie about its decimals?

Yes — the value is whatever the contract returns. Reputable tokens are consistent and well-documented, but custom or malicious contracts can return anything. Always verify against the issuer's docs when amounts matter.