What Is the Difference Between ERC-20 and ERC-721 Tokens?
ERC-20 and ERC-721 are two different token standards on Ethereum. ERC-20 defines a fungible token - each unit is identical and interchangeable, like dollars or ether. ERC-721 defines a non-fungible token (NFT) - each unit is unique and cannot be exchanged one-for-one with another, like a collectible trading card or a deed to a specific house. The core difference is fungibility.
What is a token standard?
A token standard is a set of rules a smart contract must follow to be considered a certain type of token. These rules define functions like transferring tokens, checking a balance, or approving a spend. Standards exist so that wallets, exchanges, and other applications can interact with any token that follows them, without needing custom code for each project.
ERC-20: Fungible Tokens
ERC-20, proposed in 2015 and finalized as Ethereum Improvement Proposal 20, is the most widely used standard. It creates tokens where every unit is the same. One USDC is always worth the same as another USDC. One UNI is identical to another UNI.
Key characteristics: - Fungible: Tokens are interchangeable. - Divisible: You can send fractional amounts, down to 18 decimal places by default (though projects can choose fewer). - Transferable: Any holder can send tokens to any address. - Total supply: The contract tracks how many tokens exist.
Common uses: - Stablecoins (USDC, DAI) - Governance tokens (UNI, AAVE) - Utility tokens (LINK, CHAIN) - Wrapped assets (WETH, WBTC)
How it works (simplified): An ERC-20 contract maintains a mapping of addresses to balances. When you send tokens, it subtracts from your balance and adds to the recipient's. The standard requires functions like balanceOf(address), transfer(address, uint256), and approve(address, uint256).
ERC-721: non-fungible tokens (nfts)
ERC-721, finalized in 2018, creates tokens where each one is unique. Instead of having a balance of identical items, you own specific token IDs. Each token ID has its own owner and can have its own metadata (name, image, attributes).
Key characteristics: - Non-fungible: Each token is distinct and cannot be swapped one-for-one. - Indivisible: You cannot send half an NFT. You own the whole token or none of it. - Unique ID: Every token has a numeric identifier within the contract. - Metadata: The contract can link each token ID to external data (usually via a URI pointing to a JSON file on IPFS or a server).
Common uses: - Digital art and collectibles (CryptoPunks, Bored Ape Yacht Club) - In-game items (skins, weapons, land parcels) - Domain names (ENS names) - Real-world asset tokens (deeds, tickets)
How it works (simplified): An ERC-721 contract maintains a mapping of token IDs to owners. To transfer an NFT, you call safeTransferFrom(from, to, tokenId). The standard requires ownerOf(tokenId), balanceOf(address) (how many NFTs that address holds), and safeTransferFrom.
Comparison Table
| Feature | ERC-20 | ERC-721 |
|---|---|---|
| Fungibility | Each unit is identical | Each token is unique |
| Divisibility | Divisible (usually 18 decimals) | Indivisible (whole tokens only) |
| Unit of account | Balance (a number of tokens) | Token ID (a specific identifier) |
| Transfer function | transfer(address, uint256) |
safeTransferFrom(from, to, tokenId) |
| Typical use | Currency, voting power, utility | Collectibles, art, identity |
Practical Implications
Trading. On a decentralized exchange like Uniswap, ERC-20 tokens trade in a pool. You swap any amount of one for the other at a market price. ERC-721 tokens are sold individually on marketplaces like OpenSea or Blur, each with its own price.
Wallet display. A wallet like MetaMask shows ERC-20 balances as numbers under a token symbol. ERC-721 tokens appear as individual items, often with images and names.
Approvals. ERC-20 approvals let a contract spend up to a certain amount of your tokens. ERC-721 approvals are per-token or per-collection. You approve a contract to transfer a specific token ID, or you approve it for all your tokens in that collection.
Gas costs. Minting an ERC-721 token (creating a new unique item) typically costs more gas than minting ERC-20 tokens, because the contract stores more data per token (the ID, the owner, often metadata). Transferring an ERC-721 is also usually more expensive than an ERC-20 transfer for the same reason.
What about other standards?
ERC-1155 is a hybrid standard that can create both fungible and non-fungible tokens in one contract. It is commonly used in games where you might have both gold (fungible) and swords (non-fungible). ERC-721 remains the standard for most individual NFTs because of its simplicity and widespread support.
Choosing Between Them
If you are creating a token where every unit should be identical and interchangeable, use ERC-20. If you are creating something where each instance must be unique and tracked individually, use ERC-721. The decision is straightforward: fungible or non-fungible.
Not financial advice. bidenerc.site publishes market data and general information about Biden Coin. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.