Convert ERC-20 token amounts to the base-unit integer a contract call takes and back, and see what token supply and token decimals mean. BigInt-exact.
An ERC-20 contract keeps every balance as a plain integer. The decimals() value on the contract is a display hint and nothing else: 1 USDC is stored as 1000000 because USDC reports 6 decimals, while 1 DAI is stored as 1000000000000000000 because DAI reports 18. Assume the wrong one and a transfer is off by a factor of a trillion.
This calculator does the two sums that sit around that number. It converts a human amount into the base-unit integer a contract call takes, and back again, and it measures a holding against a total supply as a percentage, in basis points, as a “1 in N” figure, and as the raw integer totalSupply() returns. Every value is computed with BigInt, so a supply with 78 digits stays exact.
2500750000000000000000, which is the integer transfer(), approve() or mint() expects.totalSupply() integer.decimals digits, and the two parts are concatenated into one integer. No multiplication by a float ever happens.decimals + 1 digits, then a point is placed decimals places from the right and trailing zeros are trimmed.0.Token supply is how many tokens exist. On an ERC-20 contract, totalSupply() returns that count in base units. Two related numbers are often quoted beside it. Circulating supply leaves out tokens that are locked, vested or held by the team. Max supply is a hard cap, if the contract has one at all.
Token decimals is how many places the smallest unit sits below one whole token. With 18 decimals, one token is 1018 base units, the same split ETH uses between ether and wei. With 6 decimals, as USDC uses, one token is 1,000,000 base units. Decimals change only how a balance is displayed. They do not change the supply or the value of what anyone holds. The EIP-20 standard even lists decimals() as optional, which is why a wallet shows a raw integer when a token leaves it out.
2500750000000000000000This is the integer a transfer(), approve() or mint() call takes on-chain.
Percent of supply
0.000250075%
Basis points
0.0250075 bps
Rarity
≈ 1 token in 399,880
Raw totalSupply()
1000000000000000000000000000
decimals is not stored per balance. It is one number on the contract that every tool multiplies by, so a token with 6 decimals holding “1000000” base units is showing 1.0, not a million. Every figure here is computed with BigInt in this tab, so a 78-digit supply stays exact.