Encodings

Encodings

Every encoding the package ships with its alphabet and overhead and checksum and options. Read live from the registry
encodings()20 encodings · listing order
OptionsStandard
Binarybinary2 charsoverhead +700%checksum noseparate?, symbols?, bits?, order?Base2, most significant bit first
Octaloctal8 charsoverhead +172%checksum noseparate?Byte values in base 8
Decimaldecimal10 charsoverhead +156%checksum nocodepoints?, separate?Byte values in base 10; Unicode code points
Integerinteger10 charsoverhead +141%checksum noradix?, digits?, bijective?, width?Unsigned big-endian integer in a positional numeral
Hex (Base16)hex16 charsoverhead +100%checksum nocodepoints?, upper?RFC 4648 §8; Unicode code points
Base32base3232 charsoverhead +60%checksum noalphabet?, padding?, canonical?RFC 4648 §6 and §7, Crockford's Base32, z-base-32
Base45base4545 charsoverhead +48%checksum nono optionsRFC 9285
Base58base5858 charsoverhead +37%checksum optionalphabet?, check?, blocks?Bitcoin Core base58.cpp, Monero common/base58.cpp, Flickr short URLs, XRP Ledger addresses
Base64base6464 charsoverhead +33%checksum noalphabet?, padding?, canonical?RFC 4648 §4 and §5
Base85base8585 charsoverhead +25%checksum noalphabet?, delimiters?RFC 1924 alphabet in git's grouping, Adobe Ascii85, ZeroMQ RFC 32/Z85
basE91base9191 charsoverhead +23%checksum nono optionsJoachim Henke, basE91 reference implementation (base91.sourceforge.net)
Base256base256256 charsoverhead +0%checksum noalphabet?, symbols?, sample?, multibase?multiformats base256emoji
Bech32bech3232 charsoverhead +62%checksum yesprefix, limit?, m?BIP173, BIP350 (Bech32m)
uuencodeuuencode64 charsoverhead +38%checksum noname?, mode?POSIX uuencode(1) and uudecode(1)
Quoted-Printablequoted-printable96 charsoverhead +125%checksum nono optionsRFC 2045 §6.7
HTML character referenceshtml96 charsoverhead text onlychecksum noascii?WHATWG HTML, named and numeric character references
ITA2 (Baudot-Murray)ita22 charsoverhead text onlychecksum noalphabet?, order?, numbers?, separate?ITU-T S.1 (ITA2); CCITT-1 (ITA1); US-TTY
Prefix codeprefix2 charsoverhead text onlychecksum nocodebook?, code?, n?, separate?Kraft-McMillan inequality; Elias, IEEE Trans. Inf. Theory 21 (1975)
Chess squaressquare16 charsoverhead text onlychecksum nolayout?, pairs?, bitboard?FIDE Laws of Chess, Appendix C (algebraic notation)
FENfen34 charsoverhead text onlychecksum nolayout?, diagram?, bitboards?, turn?, castling?, enPassant?, halfmove?, fullmove?PGN Standard §16.1 (Forsyth-Edwards Notation)
read from the registry in your browser / no networkoverhead on random bytes · a name with ? is optional

Every row is create(name).info(), computed in your browser from the registry the CLI and the agent tools read. Sort by overhead and watch binary sit at the bottom with +700%. Sort by alphabet and base256 wins with 256 emoji. Among the printable ASCII ones basE91 wins, Quoted-Printable cheats.

Picking one

Need it to survive a URL? base64 with the url alphabet. An email body? base64, which MIME already speaks. A person reading it aloud over a bad phone line? base32 with Crockford's alphabet or z-base-32.

Something money gets sent to? Anything with a checksum. Base58Check catches most typos, bech32 and bech32m catch any four. Plain base58 catches none, and that's why it never travels alone in Bitcoin.

Matching what somebody else wrote? Their spec wins, every time. A QR code wants base45. A PDF stream wants Ascii85. ZeroMQ wants Z85. They look alike and they're not interchangeable.

Squeezing bytes into the fewest printable characters? basE91, at about 23% overhead. Nobody else will read it, so make sure you're the only reader.