Multibase
Multibase is a self-describing encoding prefix scheme: a single-character prefix identifies the encoding of the data that follows (e.g., B for Base64, f for hex, z for Base58BTC), proposed by IPFS/Multiformats.
Purpose
It makes an encoded string carry its own encoding information, so the decoder can identify it without prior agreement and avoid ambiguity.
Mechanism
The prefix character comes from the Multibase registry: f = base16, F = base16upper, b = base32, B = base32upper, z = base58btc, m = base64, M = base64upper, and so on. To decode, look up the first character to determine the encoding, then decode the remainder accordingly.
Use cases
- IPFS CIDs (content identifiers)
- libp2p multiaddr encoding
- W3C DIDs (decentralized identifiers)
- Self-describing data exchange
Examples
- Input
0x48656c6c6fOutputf48656c6c6fThe f prefix denotes hex
Common errors
- Using an unregistered prefix character
- Consult the Multibase registry and use registered prefixes only
Related terms
Base64
Base64 maps arbitrary binary data onto 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) so that binary data can travel over text-only channels. GLOSSARY
Base32
Base32 maps binary data onto a 32-character alphabet (A-Z and 2-7); the output uses only uppercase letters and digits, which makes it easy to read aloud and type by hand. GLOSSARY
Base58
Base58 is a human-oriented binary-to-text encoding using 58 characters (dropping the easily confused 0, O, I, l, +, and / from Base64), best known for cryptocurrency addresses. GLOSSARY
Base16
Base16 is hexadecimal encoding: every 4 bits map to one hexadecimal character (0-9, A-F), making it the simplest member of the Base family defined by RFC 4648. GLOSSARY
Related tools
Base64 Encoder
Encode text or binary data to Base64 online. Free, private, and 100% client-side. TOOL
Hex Encoder
Encode text to hexadecimal online. Free, private, and 100% client-side. TOOL
Multibase Encode
Multibase Encode — pure client-side tool. Privacy-first, no server round-trip. TOOL
Multibase Decode
Multibase Decode — pure client-side tool. Privacy-first, no server round-trip. TOOL