Base32Hex Encoder and Decoder

Extended hex Base32 variant used in DNSSEC NSEC3 and sortable IDs

Ad placeholder (leaderboard)

Base32hex is the extended-hex variant of Base32 from RFC 4648. It encodes the same 5-bits-per-character data, but with an alphabet that preserves sort order, which makes it the format behind DNSSEC NSEC3 records and similar order-sensitive keys.

How it works

Encoding is identical to standard Base32 except for the symbol table. Bytes are read as a bit stream and chopped into 5-bit groups, each mapped through the extended-hex alphabet:

alphabet = 0123456789ABCDEFGHIJKLMNOPQRSTUV   (index 0..31)
emit one character per 5 bits, zero-fill the last group
pad with '=' to a multiple of 8 characters (optional)

Because index 0 maps to 0 and the values climb monotonically through the digits and then the letters, the lexical order of two encoded strings matches the numeric order of the bytes they encode.

Example and tips

The text Gera Tools encodes to 8TIN4O90AHNMUR3J in Base32hex (compare the standard-Base32 result, which uses a different alphabet). Reach for Base32hex specifically when you need encoded values to sort correctly as plain text; for a general-purpose, widely-supported encoding, standard Base32 is the safer default because more libraries decode it out of the box.

Ad placeholder (rectangle)