Code
Ways of writing that hide nothing by design — bases, bits, binary formats, floats, Unicode, Roman numerals, timestamps, coordinates, check digits — read and written both ways.
Base Converter
Reads a text in one format and writes it in another: text in UTF-8 or EBCDIC, binary, hex, decimal, octal, the Base64, Base32, Base58, Base85 and Base45 family, Crockford’s Base32 and z-base-32, uuencode, proquints, Modhex, Bubble Babble, COBS, BIP-39’s words, URL encoding, Punycode, HTML entities, escapes and quoted-printable; a hex dump and a JSON Web Token are read. Each by its specification, named in About.
Terms
History, how it works, how it was checked, limits
History
RFC 4648 (2006) specifies Base16, Base32 and Base64, the last also URL-safe; RFC 3986 percent-encoding, RFC 7519 the JSON Web Token. Ascii85 is Adobe’s; Base58 is Bitcoin’s alphabet. uuencode is Unix’s, written down by POSIX; Crockford’s Base32 (2002) leaves out I, L, O and U; proquints (Wilkerson, 2009) make sixteen bits five letters to say aloud; Punycode (RFC 3492, 2003) writes domain names in ASCII; Base45 (RFC 9285, 2022) writes two bytes in three characters; COBS (1999) takes the zeros out of a packet. EBCDIC is IBM’s character code; BIP-39 (2013) writes a wallet’s secret bytes as words.
How it works
One text is read in one format and written in another. Every format goes both ways but a hex dump and a JWT, which are only read. BIP-39 takes 16, 20, 24, 28 or 32 bytes and sets after them a checksum from their SHA-256; its text and result are kept out of saved sessions and links until the field is emptied. Under the result the bytes are drawn as their bits, each format’s symbols over the bits they stand for, as RFC 4648 §9 draws Base64’s, with a hex dump. Bytes that are not UTF-8 are shown as hexadecimal; a JWT is read out as header, payload and signature, its times as dates, and an HMAC signature checked against a secret typed under it.
How it was checked
Every codec but BIP-39’s is utils/encodings.js’s. Base64 and Base32 reproduce RFC 4648’s test vectors both ways; Base58 gives the Bitcoin wiki’s 2NEpo7TZRRrLZSi2U for “Hello World!”; a JWT is read on RFC 7519’s example and its HMAC checked on RFC 7515’s. Base45 gives RFC 9285’s examples; proquints Wilkerson’s twelve addresses; Punycode RFC 3492’s samples A, B, L and S; uuencode the lines Python’s binascii writes; Crockford’s Base32 the ULID specification’s example. Bubble Babble, Modhex and COBS give their sources’ own examples. EBCDIC decodes all 256 bytes as Python’s cp037 codec does; BIP-39 gives the 24 English vectors it names, both ways. The drawing gives RFC 4648 §9’s three examples.
The tests hold 162 checks of this tool; 45 rest on outside material, the first eight here:
- A standard’s own vectors Base64 (RFC 4648 §10)
- A standard’s own vectors Base32 (RFC 4648 §10)
- A standard’s own vectors Quoted-printable (RFC 2045)
- A standard’s own vectors Base64 (RFC 4648 §10): foobar
- A standard’s own vectors Base32 (RFC 4648 §10): foobar
- A standard’s own vectors Every two-way format returns what it was given (proquints, of sixteen bits, an even number of bytes; BIP-39’s words, of 16 to 32, these 16)
- A standard’s own vectors JWT (RFC 7519 §3.1): header and claims read
- A standard’s own vectors RFC 4648 §9: 0x14fb9c03d97e drawn as the RFC draws it, 8-bit to 6-bit
The other 37, and every tool’s checks
Limits
Decimal and octal are bytes, not numbers: 1000 is refused. A JWT’s signature is checked only where it is an HMAC. EBCDIC is code page 037 alone; of BIP-39 only the English list, and the seed it makes of the words is not made. Bech32, Base62, basE91 and the PGP word list are left out; Sources & method says why. The hex dump shows the first 512 bytes.
- M. Jones, J. Bradley and N. Sakimura, JSON Web Signature (JWS), RFC 7515 (2015), with its example of Appendix A.1
- Zooko O’Whielacronx, Human-oriented base-32 encoding (2002): z-base-32
- Antti Huima, The Bubble Babble Binary Data Encoding (draft, 2000), with its test vectors
- Yubico, the modhex manual: the Modhex alphabet and its examples
- S. Cheshire and M. Baker, Consistent Overhead Byte Stuffing, IEEE/ACM Transactions on Networking 7 (1999): Fig. 1 and Listing 1
- N. Freed and N. Borenstein, MIME Part One, RFC 2045 (1996), §6.7: quoted-printable
- RFC 4648, The Base16, Base32, and Base64 Data Encodings (2006)
- RFC 3986, Uniform Resource Identifier (URI): Generic Syntax (2005)
- RFC 7519, JSON Web Token (JWT) (2015)
- P. Fältström, F. Ljunggren and D. van Gulik, RFC 9285, The Base45 Data Encoding (2022)
- A. Costello, RFC 3492, Punycode (2003)
- D. Crockford, Base 32 (2002, revised 2019)
- D. S. Wilkerson, A Proposal for Proquints: Identifiers that are Readable, Spellable, and Pronounceable (2009), arXiv:0901.4016
- M. Palatinus, P. Rusnak, A. Voisine and S. Bowe, BIP-39, Mnemonic code for generating deterministic keys (2013), and its English word list
- Unicode, cp037_IBMUSCanada to Unicode table (Microsoft, 1996, table version 2.00), CP037.TXT
- The Open Group Base Specifications Issue 7 (IEEE Std 1003.1), uuencode: the historical algorithm