The shared character legend for this reference. Cards name an alphabet and link here instead of reprinting the symbol set on every page.
An alphabet is the set of symbols a format permits. It is not a length rule, not a structure rule and not a meaning; it is a list of characters that may appear, and by implication a much longer list that may not.
Four of them account for nearly every string on this site. They differ in size, in whether upper and lower case are the same thing, and in which characters they deliberately refuse. Those differences are what let you tell, from a string alone, which family it was drawn from.
Hexadecimal
Sixteen symbols: the digits 0 to 9 and the letters a to f. Nothing else belongs, and the first letter that does not belong is g, which is why a stray g is the classic tell that a run of hex has been corrupted or was never hex.
Case does not carry meaning. The same value may be printed in lower case in one place and upper case in another, and the two are the same value. Individual tools are consistent within themselves, so a run that changes case halfway is worth a second look, but the change alone is not a fault.
One symbol accounts for one of sixteen possibilities, so two symbols cover exactly one byte. Hex lengths are therefore almost always even, and an odd count means a character has gone missing or an extra one has arrived.
Base32, in the form onion addresses use
Thirty two symbols: the twenty six letters of the Latin alphabet, plus six digits, 2 through 7. Addresses are published in lower case and this reference treats them that way throughout.
Four digits are absent: 0, 1, 8 and 9. Each of them, in the typefaces people actually read addresses in, sits close enough to one of the twenty six letters that keeping both would invite transcription errors. Leaving them out costs nothing, because the alphabet only needs thirty two symbols and there are thirty two available without them.
One symbol selects among thirty two possibilities, so a run of eight symbols covers five whole bytes with nothing left over. That is why base32 strings tend to come in lengths divisible by eight, and why the padding character other base32 variants use does not appear in the address form at all.
Base58
Fifty eight symbols: all the ASCII alphanumerics, which is sixty two, minus four. The four removed are the digit zero, capital O, capital I and lower case L. They were dropped for the same reason base32 dropped its digits, and the choice was made on the assumption that a human would sometimes read one of these strings aloud or copy it out by hand.
Case is significant here. Changing a letter from upper to lower produces a different string, and where the format carries a checksum, that different string will fail it.
No punctuation belongs to this alphabet at all. That is a deliberate property: a base58 string survives being double clicked, wrapped across a line or pasted next to a full stop without the surrounding characters being mistaken for part of it.
One symbol carries a shade under six bits, and not a whole number of them. Lengths in this alphabet are therefore not fixed by arithmetic the way hex lengths are, and two values of the same size in bytes can encode to strings of slightly different length.
Base64
Sixty four symbols: the sixty two alphanumerics with nothing removed, plus two more. Conventionally those two are the plus sign and the forward slash. A variant intended for use inside links substitutes a hyphen and an underscore for them, and that substitution is the main thing that varies between base64 dialects you will meet.
The equals sign is not a symbol of the alphabet. It is padding, it appears only at the very end of a string, and it appears at most twice.
Case is significant. Unlike hex, an upper case letter and its lower case twin are different symbols with different values.
One symbol carries six bits, so four symbols cover three bytes exactly. That is the whole reason padding exists: when the input does not divide into three byte groups, the output is topped up to a multiple of four.
Telling them apart on sight
You will more often be handed a string than told which alphabet it belongs to. The order below settles it in most cases without counting anything.
- Look for a character outside the alphanumerics. A plus, a forward slash, or a short run of equals signs at the end, puts you in base64 and nowhere else.
- Look at case. If both upper and lower case letters appear in the same string, it is not the onion form of base32, and it is not hex in any printing you will meet here. That leaves base58 and base64.
- Look for a letter past f. If one appears, hex is out. If none appears anywhere in a long string, hex becomes the likely reading and the length will usually be even.
- Look at which digits appear. Over a long string, base32 in the onion form will never show 0, 1, 8 or 9, while base58 will never show 0 and base64 shows all ten.
- Look for the four base58 exclusions. A capital O, a capital I, a lower case L or a zero rules base58 out immediately.
Short strings resist all of this. The six characters abc123 are valid hexadecimal, valid base58 and valid base64 at once, and there is no reading of them that settles the question. Length and the context the string arrived in do that work, not the alphabet. Where a string is short enough to be ambiguous, the card for the format it claims to be will give the length that would settle it.
The four side by side
| Alphabet | Symbols | Case | Absent from it | Where you meet it on this site |
|---|---|---|---|---|
| Hexadecimal | 16 | either case, same value | every letter after f | A file hash, a key fingerprint, a transaction id |
| Base32, onion form | 32 | lower case as printed | the digits 0, 1, 8 and 9 | The onion address, the sixteen character form |
| Base58 | 58 | both, and it matters | 0, capital O, capital I, lower case L, all punctuation | A Bitcoin address in the older alphabet, a Monero address |
| Base64 | 64, plus padding | both, and it matters | nothing alphanumeric is excluded | Armoured blocks, a captcha token |
An alphabet narrows the field and it is the cheapest of the checks on this site, since it costs one look and no counting. What it settles, and the far longer list of things it leaves untouched, is set out on what a shape proves, and where it stops.