Written by Pablo Gómez
Founder & CEO at Metlabs · Reviewed on October 11, 2026
TokenURI, defined as tokenURI(uint256 _tokenId) returns (string) in the ERC721Metadata extension, returns a URI pointing to a JSON file with the NFT's metadata. That JSON must conform to the ERC721 Metadata JSON Schema, with standard fields such as name, description, image and, usually, attributes. The common implementation pattern uses a contract baseURI that is concatenated automatically with the token identifier. The URI can point to HTTP, IPFS, Arweave or be an on-chain data URI. In ERC-1155 the uri function supports the {id} wildcard, which the client replaces with the token identifier in 64-character hexadecimal, allowing a single template URI to serve many tokens.
It is the bridge between the on-chain token and its metadata, which often lives off-chain. It is the field marketplaces, wallets and explorers read to display an NFT's image and properties, and the exact term developers search for when integrating or debugging asset display. The persistence of what the URI points to is a critical point, hence complementary metadata integrity standards such as ERC-2477.
OpenZeppelin contracts implement it via ERC721URIStorage and _baseURI(). Well-known collections serve their metadata over IPFS while others render on-chain. MetaMask and explorers consume tokenURI or uri to display the asset. tokenURI belongs to ERC-721 and ERC-1155 and is also the identity piece inherited by extensions such as ERC-6551, where a token bound account anchors to an NFT whose identity this function defines.
Also known as
- Token URI





