NFT token IDs: decimal, hexadecimal and large integers
EVM NFT token IDs are integers. Decimal and hexadecimal can represent the same value; preserve large IDs as exact text when copying or storing them.
Worked example
| Display | Value | Annotation |
|---|---|---|
| 42 | Decimal 42 | Illustrative ID |
| 0x2a | Hexadecimal 42 | Same integer, different notation |
| 9007199254740993 | Large integer example | Exceeds JavaScript safe integer precision |
Keep integers exact
ERC-721 uses uint256 token IDs. Converting a very large decimal ID through a JavaScript Number can round it. Use a string or BigInt in tooling and confirm which notation an import field expects.
Do not confuse numbers with identity
A token named “#42” may have a different underlying ID if the collection’s naming convention differs. Read the actual token-ID field. ERC-1155 metadata URI substitution uses a padded hexadecimal form, which is another reason the displayed decimal text can differ from a URL fragment.
Common pitfalls
- The values here are explanatory fixtures, not proof that a named NFT exists.
- Leading zeroes in a display do not create a new integer ID.
Related references
Primary sources
Examples explain identifiers. They are not investment recommendations.