This tool converts text data into "Base32" format (encoding) and back (decoding). Its key feature is processing text via the UTF-16BE format to correctly handle multi-byte characters like Japanese.
Encoding Flow (Text → Base32)
- Text to UTF-16BE: Each character of the input text is converted into a sequence of bytes in UTF-16BE (Big-Endian) format. For example, "A" becomes
00 41
, and "あ" becomes 30 42
.
- Bytes to Bits: This sequence of bytes is treated as a continuous stream of bits (0s and 1s).
- Group into 5-bit chunks: The bitstream is divided into groups of 5 bits each.
- Convert to Base32 Characters: Each 5-bit group is mapped to a corresponding character in the Base32 alphabet (
A-Z
and 2-7
).
- Padding: If the final group has fewer than 5 bits, the resulting Base32 string is padded with
=
characters at the end to make its length a multiple of 8.
Decoding Flow (Base32 → Text)
- Remove Padding: Any
=
characters are removed from the end of the Base32 string.
- Base32 Characters to Bits: Each character is converted back to its corresponding 5-bit value.
- Bits to Bytes: The resulting bitstream is reassembled into 8-bit groups (bytes).
- UTF-16BE to Text: The byte sequence is interpreted as UTF-16BE and converted back into the original text.
Advantage Over Base64
The primary advantage of Base32 is its human-readability and reduced chance of transcription errors. The character set is not case-sensitive and intentionally omits characters that look similar, such as 0
(zero) and O
(letter O), or 1
(one), I
(capital i), and l
(lowercase L). This makes it a more robust choice for situations where data might be written down or read out loud by a person.