Base32 Alternatives: Z-Base32, Base32Hex and Crockford's Base32

Base32 Variants: Z-Base32, Base32Hex and Crockford’s Base32

In this article, we will examine the variants to Base32 based on their functions, uses and character sets to get an accurate picture of the advantages, disadvantages and differences between these methods.

Explanation of Base32

At its core, Base32 encoding is a way to convert binary data into a sequence of characters from a predefined set. These characters are chosen to ensure that the resulting encoded data is human-readable and free from characters that might be confused when transmitted or copied. The most common set of characters used in Base32 encoding includes the digits 0-9 and a selection of uppercase letters (usually A to Z), but there are different variants like Base32Hex and Crockford’s Base32 that use their own character sets.

Base32 encoding finds applications in various fields, such as:

  • Data Integrity: When transmitting data over unreliable channels, Base32 encoding is often used to include checksums to detect errors or ensure data integrity.
  • Cryptographic Keys: Cryptographic keys, which are often binary data, are encoded in Base32 to make them easier to share and store.
  • URLs and Identifiers: In web applications and database systems, Base32-encoded data can be used for generating unique identifiers and encoding URLs.

Here are the 32 characters used in Base32:

BinaryDecimalBase32
000000A
000011B
000102C
000113D
001004E
001015F
001106G
001117H
010008I
010019J
0101010K
0101111L
0110012M
0110113N
0111014O
0111115P
1000016Q
1000117R
1001018S
1001119T
1010020U
1010121V
1011022W
1011123X
1100024Y
1100125Z
11010262
11011273
11100284
11101295
11110306
11111317

Z-Base32: An Improved Variant

Z-Base32 was introduced as a response to the limitations of traditional Base32 encoding. It was designed to provide a more reliable and user-friendly alternative, primarily in the context of data integrity and data transmission. The “Z” in Z-Base32 stands for “zero confusion,” emphasizing its commitment to eliminating potential ambiguities in encoded data.

Z-Base32 incorporates several features that set it apart from the conventional Base32 encoding:

  • Improved Readability: Z-Base32 uses a character set that avoids confusion between visually similar characters, such as ‘0’ and ‘O,’ ‘1’ and ‘I,’ and ‘8’ and ‘B.’ This enhances human readability, reducing the risk of transcription errors.
  • Enhanced Data Integrity: With a carefully selected set of characters and a strong focus on avoiding look-alike characters, Z-Base32 excels at ensuring data integrity. It’s well-suited for applications where data accuracy is of utmost importance, such as cryptographic key sharing.
  • Robust Error Detection: Z-Base32 is designed to be more resistant to errors during transmission. It achieves this by minimizing the chance of misinterpretation due to similar-looking characters, reducing the risk of data corruption.

Z-Base32 finds applications in various domains:

  • Cryptographic Keys: In secure systems, Z-Base32 is preferred for encoding cryptographic keys because it reduces the likelihood of errors when entering or transmitting sensitive information.
  • Barcoding: Z-Base32’s improved readability makes it suitable for barcoding applications, where quick and accurate scanning of data is crucial.
  • Data Validation: It is used in scenarios where data validation and error-checking are paramount, such as checksums and data transfer protocols.

Z-Base32 Characters:

DecimalZ-Base32
0y
1b
2n
3d
4r
5f
6g
78
8e
9j
10k
11m
12c
13p
14q
15x
16o
17t
181
19u
20w
21i
22s
23z
24a
253
264
275
28h
297
306
319

Base32Hex: A Different Approach

Base32Hex is a distinctive encoding scheme that deviates from the conventional Base32 in some fundamental ways. One of its notable features is its use of a hexadecimal character set, offering a fresh perspective on encoding binary data.

Base32Hex’s unique approach makes it a valuable choice in specific use cases:

  • Hexadecimal Data Representation: When dealing with binary data that naturally aligns with hexadecimal values, Base32Hex simplifies the encoding process.
  • URLs and Filenames: Base32Hex is often used in URLs and filenames, where compact representation and avoidance of special characters are beneficial.
  • Data Transfer: In scenarios where compactness and easy parsing are crucial, such as in QR codes or data transfer protocols, Base32Hex can be a strong contender.

Base32Hex Characters:

DecimalBase32Hex
00
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F
16G
17H
18I
19J
20K
21L
22M
23N
24O
25P
26Q
27R
28S
29T
30U
31V

Crockford’s Base32: A User-Friendly Option

Crockford’s Base32 was conceived by Douglas Crockford, a prominent figure in the fields of computer programming and web development. It was designed with a specific focus on creating an encoding scheme that minimizes the potential for human error when transcribing or entering data. Crockford’s experience in designing human-readable data formats, including JSON, influenced the development of this variant.

Crockford’s Base32 offers several features that cater to user-friendliness:

  • Avoidance of Confusing Characters: One of the primary goals of Crockford’s Base32 is to eliminate characters that can be easily confused when handwritten or transcribed.
  • Case Insensitivity: Crockford’s Base32 is case-insensitive, meaning that uppercase and lowercase letters are treated as equivalent. This reduces the likelihood of errors caused by letter case discrepancies, making it particularly user-friendly.
  • No Padding: Unlike some other Base32 variants that use padding to achieve a fixed block size, Crockford’s Base32 does not use padding. This simplifies the encoding and decoding processes, as the encoded data always has a variable length.

Use Cases of Crockford’s Base32:

  • Vehicle Identification Numbers (VINs): Crockford’s Base32 is used to encode VINs to make them more user-friendly for vehicle owners and service providers.
  • Serial Numbers: Manufacturers often use this encoding for serial numbers on products, ensuring that users can easily identify and enter them without errors.
  • Checksums and Short Identifiers: Crockford’s Base32 is useful for encoding checksums and creating short, easily transcribable identifiers.

Crockford’s Base32 Characters:

Symbol ValueDecode SymbolEncode Symbol
00 O o0
11 I i L l1
222
333
444
555
666
777
888
999
10A aA
11B bB
12C cC
13D dD
14E eE
15F fF
16G gG
17H hH
18J jJ
19K kK
20M mM
21N nN
22P pP
23Q qQ
24R rR
25S sS
26T tT
27V vV
28W wW
29X xX
30Y yY
31Z zZ

Comparing Z-Base32, Base32Hex, and Crockford’s Base32

Below you can compare exactly the characters of the different encoding methods.

Base32Z-Base32Base32HexCrockford’s Base32
Ay00
Bb11
Cn22
Dd33
Er44
Ff55
Gg66
H877
Ie88
Jj99
KkAA
LmBB
McCC
NpDD
OqEE
PxFF
QoGG
RtHH
S1IJ
TuJK
UwKM
ViLN
WsMP
XzNQ
YaOR
Z3PS
24QT
35RV
4hSW
57TX
66UY
79VZ