Hex to Base32 Converter

The Hex to Base32 Converter takes the bytes you paste into Hex Input and encodes them using standard RFC 4648 Base32. Click Convert and the encoded string lands in Base32 Output, ready to drop into anything that expects Base32 text. The fastest way to convert hex bytes into Base64 text is the hex to base64 converter, which produces a ready-to-copy string with one click.

How the Hex to Base32 Converter Encodes Your Data

What Hexadecimal and Base32 Each Represent

Hexadecimal (base-16) writes each byte as two characters from 0–9 and a–f, with every hex digit standing for exactly 4 bits. Base32, defined in RFC 4648, is a different way of representing the same underlying bytes as plain text: it uses a 32-character alphabet (A–Z and 2–7) where every character carries 5 bits instead of 4. Converting hex to Base32 doesn't change the data itself — it just re-encodes the same bytes into a format that's more compact and easier for people to read, type, or speak aloud than raw hex or binary.

  • Hex uses 2 characters per byte; Base32 uses roughly 1.6 characters per byte, so Base32 output is shorter than the equivalent hex.
  • Base32's alphabet skips 0, 1, 8, and 9 specifically to avoid confusion with O, I/L, and B when read or transcribed by hand.
  • Both are just different textual representations of the same binary data — hex is common in programming and debugging contexts, Base32 in places meant to be typed or shared as plain text.

Step-by-Step: From Hex Bytes to Base32 Text

  1. Enter hex data. For example, 4D616E (three bytes).
  2. Expand each hex digit to 4 bits: 4D616E01001101 01100001 01101110 (24 bits total).
  3. Re-group the same bitstream into 5-bit chunks instead of 4-bit ones: 01001 10101 10000 10110 1110.
  4. Pad the final chunk with zero bits if it's short of 5 bits, then map every 5-bit chunk to its RFC 4648 Base32 character (A–Z, 2–7).
  5. Pad the output with trailing = characters until its length is a multiple of 8.

This converter's output is always standard RFC 4648 Base32 in uppercase — there's no separate uppercase/lowercase or grouping option on this page, since Base32 encoding only ever produces one canonical form.

Infographic showing how to convert hex 4869 to Base32: write each byte as 8 bits, regroup into 5-bit chunks, and map each chunk to the Base32 alphabet to get JBUQ====
Hex to Base32 Converter: 48 69 = JBUQ====

Why Convert Hex to Base32

  • TOTP and HOTP secrets. Authenticator apps almost universally store and display their shared secret key as Base32, not hex, so it can be typed manually if a QR code scan fails.
  • Human-readable identifiers. Base32's restricted, case-insensitive alphabet makes it a safer choice than hex or Base64 for values a person might need to read back or retype correctly.
  • URL- and filename-safe encoding. Base32's alphabet contains no characters that need escaping in URLs, filenames, or DNS labels.
  • Cross-checking a decoder. If you're building your own Base32 decoder, encoding known hex bytes here and comparing the output is a quick correctness check.

Worked Example: Encoding Hex to Base32 by Hand

Convert 4D616E to Base32
  1. Hex input: 4D616E (the ASCII bytes for “Man”)
  2. Binary: 010011010110000101101110
  3. Split into 5-bit groups: 01001 10101 10000 10110 1110. The last group only has 4 bits, so it's padded with one zero: 11100.
  4. Map each 5-bit value to a Base32 character (indexes 9, 21, 16, 22, 28): J, V, Q, W, 4.
  5. Pad to a multiple of 8 characters: 5 characters plus 3 = signs → JVQW4===.

Sample Code: Python and JavaScript

Python
import base64

hex_input = '4D616E'
byte_data = bytes.fromhex(hex_input)
base32_encoded = base64.b32encode(byte_data).decode()
print(base32_encoded)  # JVQW4===
JavaScript
function hexToBase32(hex) {
  const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
  const bytes = hex.match(/.{1,2}/g).map(b => parseInt(b, 16));
  let bits = bytes.map(b => b.toString(2).padStart(8, '0')).join('');
  let out = '';
  for (let i = 0; i < bits.length; i += 5) {
    const chunk = bits.substr(i, 5).padEnd(5, '0');
    out += alphabet[parseInt(chunk, 2)];
  }
  while (out.length % 8 !== 0) out += '=';
  return out;
}
// hexToBase32('4D616E') -> 'JVQW4==='

Both snippets implement the same standard RFC 4648 encoding this page's converter uses, and were checked against the worked example above. Anyone working with an unusual base-12 numbering system can rely on the base12 to hex converter to get a standard hexadecimal result.

Frequently Asked Questions

Does this tool send my data anywhere?

No. The hex to Base32 converter runs entirely client-side in your browser's JavaScript — nothing you type into Hex Input is sent to a server.

Is the Base32 output case-sensitive?

The encoder always produces uppercase output, matching the standard RFC 4648 alphabet. When decoding Base32 elsewhere, most implementations (including the Base32 to Hex Converter on this site) accept lowercase input too, since decoding is case-insensitive even though encoding always emits uppercase.

Is Base32 more compact than hex?

Yes. Base32 packs 5 bits into every character versus hex's 4 bits per character, so a Base32-encoded value is shorter than the same data represented in hex — useful when you're transcribing or storing the text form of a key or token.

Can I decode Base32 back to hex?

Yes — use the Base32 to Hex Converter on this site for the reverse conversion. It accepts standard RFC 4648 Base32 (including the = padding this tool produces) and decodes it back to the original hex bytes.

What if my hex string has an odd number of digits?

Hex represents whole bytes, so it needs an even number of digits (two per byte). An odd-length hex string doesn't map to a whole number of bytes and won't encode correctly — pad it with a leading zero if you're missing one.