Custom Alphabet Encoder and Decoder

Type your own alphabet or start from a preset, then encode or decode with it. Choose big number for any alphabet length, or bit groups for RFC 4648 style output.

Runs entirely in your browser. Nothing is uploaded.

How to use

  1. Type your alphabet, or pick a preset and edit it. Each character may appear only once.
  2. Choose the method: big number for any alphabet length, or bit groups for alphabets of 2, 4, 8, 16, 32 or 64 characters.
  3. With bit groups, optionally enter a padding character that is not part of the alphabet.
  4. Encode your text, or paste a string written in your alphabet to decode it.

Two ways to map bytes to characters

Big number works like Base58. The whole input is read as one large integer and divided again and again by the length of the alphabet; each remainder picks a character. It works for any alphabet of at least 2 characters, such as 10, 36, 58 or 62. Leading zero bytes are written as the first character of the alphabet, so they survive a round trip. There is no padding, and input is limited to about 20 KB because the arithmetic gets slow on long data.

Bit groups work like RFC 4648. The input is cut into chunks of a fixed number of bits: 1 bit for a 2-character alphabet, 4 bits for 16, 5 bits for 32 and 6 bits for 64. Each chunk is an index into the alphabet. This is exactly how hex, Base32 and Base64 work, and the output length depends only on the input length.

Why the two methods give different results

One method encodes the numeric value of the data, the other its bits position by position. The results usually differ, and a string must be decoded with the method that produced it.

AlphabetInputBit groupsBig number
Standard Base64HiSGk=Ehp
RFC 4648 Base32HiJBUQ====SDJ
01A010000011000001
0123456789Hinot available18537

With bit groups and = as padding, the standard alphabets reproduce normal Base64 and Base32. Big number drops the leading zero bit of A because it writes a value, not a fixed number of bits. With the ten digits as the alphabet, it simply shows the bytes of Hi as a decimal number.

The padding character only applies to bit groups. Output is padded to a multiple of 4 characters for 64-character alphabets and to a multiple of 8 for 32- and 8-character alphabets. With 2, 4 or 16 characters every byte fills whole characters, so padding is never needed.

Rules for a valid alphabet

  • At least two characters.
  • No duplicates. The decoder maps every character back to exactly one value. If a stood for both 0 and 10, a string containing it could not be decoded.
  • Case matters. a and A are different characters.
  • The padding character must not be in the alphabet, or it could not be told apart from data.

Everything runs in your browser, so your alphabet and data stay on your device.

When a custom alphabet helps

  • Obfuscated IDs. A shuffled alphabet turns identifiers into tokens without an obvious pattern. This hides but does not protect: anyone who knows the alphabet can decode them.
  • Proprietary or legacy formats. Copy a system's own alphabet from its documentation and decode its data directly.
  • Learning. Compare alphabet lengths and both methods to see how base conversion works. For fixed alphabets, see Base58 and Base62.

Frequently asked questions

What is the difference between big number and bit groups?

Big number converts the whole input as one integer into the new base, like Base58, and works with any alphabet length. Bit groups split the input into fixed-size chunks of bits, like Base64, and need an alphabet of 2, 4, 8, 16, 32 or 64 characters.

Why does my custom Base64 alphabet not match standard Base64 output?

Standard Base64 uses bit groups. Choose the bit groups method and set = as the padding character to match it. The big number method produces a completely different string from the same alphabet.

Why are duplicate characters not allowed?

Each character must decode to exactly one value. A repeated character would have two meanings, and the original data could not be recovered reliably.

Can I use a padding character with the big number method?

No. Big number output has no fixed block size, so there is nothing to pad. The padding option only applies to bit groups.

Is a custom alphabet a form of encryption?

No. It is still an encoding without a key. A shuffled alphabet can make data harder to recognize at a glance, but it should never be used to protect secrets.