Convert between hexadecimal, decimal, binary, and text formats
Hexadecimal (base-16) is fundamental to blockchain technology. It provides a compact way to represent binary data and is used throughout blockchain systems for addresses, transaction hashes, contract bytecode, and more.
Blockchain systems use hexadecimal because:
Ethereum addresses are 20-byte (40-character) hexadecimal values:
0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0
Transaction identifiers are 32-byte (64-character) hashes:
0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Smart contract function calls use 4-byte (8-character) selectors:
0xa9059cbb // transfer(address,uint256)
Large token amounts are often displayed in hexadecimal:
0xde0b6b3a7640000 // 1 ETH in Wei (decimal: 1000000000000000000)
| System | Base | Digits | Example (255) |
|---|---|---|---|
| Binary | 2 | 0-1 | 11111111 |
| Octal | 8 | 0-7 | 377 |
| Decimal | 10 | 0-9 | 255 |
| Hexadecimal | 16 | 0-9, A-F | FF |
Hexadecimal uses digits 0-9 and letters A-F (or a-f) to represent values 0-15:
ASCII is a character encoding standard using 7 bits per character. Common in simple text representations:
"Hello" = 0x48656c6c6f
UTF-8 supports international characters using variable-length encoding (1-4 bytes per character):
"Hello 🌍" = 0x48656c6c6f20f09f8c8d
Convert hex input data to text to understand what data was sent in a transaction.
Convert text to hex for signing messages or storing data on-chain.
Smart contract bytecode is in hexadecimal format.
NFT token IDs are often in hex format and need conversion for display.
Hex to Decimal:
0xFF = 15×16¹ + 15×16⁰ = 240 + 15 = 255
Decimal to Hex:
255 ÷ 16 = 15 remainder 15 = 0xFF
Text to Hex:
"Hi" = H(72) i(105) = 0x4869