How to convert a token amount to base units
- Verify the contract address and network using the project’s official documentation and a suitable explorer.
- Find the contract’s decimals value. ERC-20 defines this metadata method as optional; do not assume 18 when it is unavailable.
- Select the conversion direction and enter plain digits, with a decimal point only for a display amount. Do not use commas, signs or exponential notation.
- Select Convert exactly. Read both representations before using the amount elsewhere.
Worked example: six decimal places
For a hypothetical token with six decimals, 1.234567 tokens is exactly 1,234,567 base units. One base unit is 0.000001 tokens. An amount of 0.0000001 tokens cannot be represented; the converter rejects it. It does not round that amount into a valid transfer.
Why ordinary number handling can change the value
JavaScript’s standard Number type cannot represent every integer above 9,007,199,254,740,991 exactly. A raw amount can exceed that range even for an ordinary display balance. This converter parses strings into BigInt values and formats decimal positions without floating-point multiplication.
For an 18-decimal example, raw 9007199254740993123456789 becomes exactly 9007199.254740993123456789. This is a deliberately large precision exercise, not a token balance lookup.
Limits and what the result means
Decimals must be a whole number from 0 to 255, matching the ERC-20 metadata type. Raw amounts must fit the unsigned 256-bit integer range. Those type limits do not mean a real token has that supply or accepts the amount. The tool accepts nonnegative plain decimals only and rejects any fractional digits beyond the selected decimals, including additional trailing zeros. No balances, transfer restrictions, recipient or contract identity are checked.
“Base units” is the generic label here. Wei is an Ethereum native-asset denomination; not every ERC-20 token’s smallest unit is called wei. For native assets, use the ETH, SOL and XRP unit converter or Bitcoin/satoshi converter.
Source and learning path
Primary reference reviewed 29 November 2026: ERC-20 decimals and integer amounts. Read the token decimals guide, then practise in the interactive number lab.