Base-N encodings
Binary-to-text encodings: hex, Base32, Base58, Base64, Base85 and relatives
Overview
Base-N encodings represent arbitrary binary data using a restricted alphabet of printable characters so it can travel through text-only channels such as email, URLs, JSON or DNS. They are reversible transformations, not encryption, and provide no security or confidentiality.
An encoding groups input bits and maps each group to a symbol. Base16 (hex) maps 4 bits to one of 16 characters. Base32 maps 5 bits, and Base64 maps 6 bits, with '=' padding to complete the last group. Base85 and Ascii85 map 4 bytes to 5 characters for denser output. Base58, used for Bitcoin addresses, treats the whole input as a big integer and removes visually ambiguous characters such as 0, O, I and l; Base58Check adds a SHA-256-based checksum.
NextSSL includes over twenty variants: hex/Base16; Base32 with the RFC 4648 standard, extended-hex, z-base-32, DNSCurve and DNSSEC (RFC 5155) alphabets; Base64 in standard, URL-safe, unpadded, MIME, IMAP modified-UTF-7, bcrypt, crypt(3) and BinHex alphabets; Base58 with Bitcoin, Flickr and Ripple alphabets and Base58Check; Base45 (RFC 9285); Ascii85, Base85 (RFC 1924) and Z85; and basE91.
Different alphabets exist because each target channel forbids different characters: URL-safe Base64 replaces '+' and '/', and Base45 is designed to fit QR-code alphanumeric mode. Variants also differ in padding, line wrapping and case rules, so decoders must be configured for the exact flavour expected. Base64 is the most widely used, while hex is simplest to read.
History
2006–2022Specified in RFC 4648 section 8
Specified in RFC 4648 section 6
Specified in RFC 4648 section 7
Specified in RFC 4648
Specified in RFC 5155 section 3.3
Specified in RFC 9285
Security notes
Encodings provide no security: anyone can decode them. Base58Check's checksum detects typing errors but not deliberate changes. Decoders must reject non-canonical input where uniqueness matters, such as in signatures.
Typical uses
Variants in NextSSL
25| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Base16 base16 |
standard | — | RFC 4648 section 8 | safe |
| Base32 base32 |
standard | — | RFC 4648 section 6 | safe |
| Base32hex base32hex |
standard | — | RFC 4648 section 7 | safe |
| Base58 base58 |
standard | — | Bitcoin base58 (draft-msporny-base58) | safe |
| Base58check base58check |
standard | — | Bitcoin Base58Check | safe |
| Base64 base64 |
standard | — | RFC 4648 | safe |
| Base64url base64url |
standard | — | RFC 4648 section 5 | safe |
| Ascii85 ascii85 |
unverified | — | Adobe PostScript Language Reference, ASCII base-85 | root |
| Base32-Dnscurve base32-dnscurve |
unverified | — | DNSCurve base32 (dnscurve.org) | root |
| Base32-Dnssec base32-dnssec |
unverified | — | RFC 5155 section 3.3 | root |
| Base45 base45 |
unverified | — | RFC 9285 | root |
| Base58-Flickr base58-flickr |
unverified | — | Flickr base58 alphabet | root |
| Base58-Ripple base58-ripple |
unverified | — | Ripple base58 alphabet | root |
| Base64-bcrypt base64-bcrypt |
unverified | — | bcrypt radix-64 alphabet (OpenBSD) | root |
| Base64-Binhex base64-binhex |
unverified | — | BinHex 4.0 (RFC 1741) | root |
| Base64-Crypt base64-crypt |
unverified | — | crypt(3) base64 alphabet | root |
| Base64-Imap-Mutf7 base64-imap-mutf7 |
unverified | — | RFC 3501 section 5.1.3 | root |
| Base64-Mime base64-mime |
unverified | — | RFC 2045 section 6.8 | root |
| Base64-Nopad base64-nopad |
unverified | — | RFC 4648 section 4 | root |
| Base64url-Nopad base64url-nopad |
unverified | — | RFC 4648 section 5, RFC 7515 appendix C | root |
| Base85 base85 |
unverified | — | RFC 1924 | root |
| Base91 base91 |
unverified | — | basE91 (Joachim Henke) | root |
| Hex hex |
unverified | — | RFC 4648 section 8 (lowercase) | root |
| Z-Base-32 z-base-32 |
unverified | — | z-base-32 (Zooko O'Whielacronx) | root |
| Z85 z85 |
unverified | — | ZeroMQ RFC 32/Z85 (crate adds a '#' marker so lengths n… | root |
Frequently asked questions
Which Base-N encodings variants does NextSSL include?
NextSSL registers 25 Base-N encodings variants: base16, base32, base32hex, base58, base58check, base64, base64url, ascii85, base32-dnscurve, base32-dnssec and more.
Other encodings
All 28Related
Checksummed Base32 address encodings for Bitcoin SegWit and Taproot (BIP-173, BIP-350)
SHA-2The NIST Merkle–Damgård hash family behind most of today's TLS, signatures and software
bcryptThe Blowfish-based adaptive password hash, a long-standing default in web frameworks
Unix crypt formatsClassic modular-crypt password hashes: BSDi DES, md5crypt, sha256crypt and sha512crypt