Base32 to Hex Converter
Base32 to Hex Converter. Paste your string into Base32 Input and the Base32 to Hex Converter instantly decodes it back to Hex Output. Enter your hex number into the hex to base36 converter to get its compact Base36 equivalent, distinct from a byte-encoding scheme like Base64.
If an authenticator app gives you a TOTP secret as a Base32 string but your VPN, hardware token or database wants hexadecimal, a Base32 to Hex Converter turns one into the other in a single step. Every eight symbols become five bytes of binary data, which you read back as hex output and paste straight into the next system.
How a Base32 to Hex Converter Works
Base32 is a transfer encoding that spells binary data with only 32 symbols, so it survives email, spoken instructions and handwriting. Hexadecimal, also called base-16, is the format most developers use to inspect that same data. A converter reads one encoding scheme and prints the other, and nothing is lost along the way because both are just different spellings of the same octets. The fastest way to move a color from a print spec sheet into CSS is the cmyk to hex converter, which outputs a ready-to-use hex code.
In programming terms, the whole job is a change of numeric base on a stream of bits. The data never changes; only the way it is written down does, so the conversion is lossless.
Reading the base32 alphabet
The standard base32 alphabet runs from A to Z for the values 0 to 25, then 2 to 7 for the values 26 to 31. Digits 0, 1, 8 and 9 are left out so a person never confuses them with the letters O, I, B and g.
From 5 bits to 4 bits: the regrouping step
Each Base32 symbol carries 5 bits, while each hex digit carries 4 bits. The converter writes out the 5-bit groups, joins them into one long run of binary, and cuts that run into new groups of four. Because 5 and 4 do not divide each other evenly, the run only lines up with whole octets every 40 bits, which is why Base32 works in blocks of eight symbols.
Base32 to Hexadecimal Converter Formula
For an input of \(n\) real symbols (equals signs excluded), the number of bits is five times the symbol count, and only whole octets survive: The fastest way to confirm your C# hex formatting is correct is to run the number through the int to hex c# and compare results.
$$\text{octets} = \left\lfloor \frac{5 \times n}{8} \right\rfloor \qquad \text{hex digits} = 2 \times \text{octets}$$
Any leftover bits at the end are zero filler, so the converter throws them away before it writes the hexadecimal result. A Base32 value with 12 real symbols carries 60 bits, which gives \(\lfloor 60 \div 8 \rfloor = 7\) octets and 14 hex digits.
The two-stage method with decimal and positional notation
You can also convert by hand in two stages. First turn the symbols into one large decimal number using positional notation, where each symbol's numeric value is multiplied by a power of 32. Then divide that decimal result repeatedly by 16 to read off the hex digits. It works, but it is slow for long input, so tools use the regrouping route instead.
Worked Example of Base32 to Hex Conversion
Take the padded input JMO6PEVAHRKQ====. It has 12 real symbols and four trailing equals signs, so it carries 60 bits of which the last 4 are filler.
Step 1: map each symbol to a number
Look every symbol up in the table below, then write its value as five binary digits. This lookup table covers the whole input.
| Symbol | Value | Binary representation |
|---|---|---|
| J | 9 | 01001 |
| M | 12 | 01100 |
| O | 14 | 01110 |
| 6 | 30 | 11110 |
| P | 15 | 01111 |
| E | 4 | 00100 |
| V | 21 | 10101 |
| A | 0 | 00000 |
| H | 7 | 00111 |
| R | 17 | 10001 |
| K | 10 | 01010 |
| Q | 16 | 10000 |
Step 2: join the bits and drop the filler
Concatenating the twelve groups gives 60 bits. The final four are filler, which leaves 56 bits: 01001011 00011101 11100111 10010010 10100000 00111100 01010101.
Step 3: regroup into nibbles
Cut the 56 bits into fourteen groups of four. Each group is a nibble, and each nibble is one hexadecimal symbol: 4, B, 1, D, E, 7, 9, 2, A, 0, 3, C, 5, 5. The result is 4B1DE792A03C55, seven bytes, exactly as the formula predicted.
Reading the Hex Output of a Base32 to Hex Conversion
The hexadecimal result is an exact picture of the data, but a conversion preserves values, not meaning. Whether 4B1DE792A03C55 is a secret, a hash or a piece of text depends on where it came from.
ASCII, UTF-8 and other output encoding choices
Some tools let you pick an output encoding after decoding. Choosing hex shows the raw values; choosing ASCII or UTF-8 tries to read them as text, which only makes sense when the original value was a message. For key material the text view looks like noise, so stay with hex.
Base 32 to Hex Converter Options: Case, Padding and Prefix
Most tools expose a few conversion switches that change how the result looks without changing its value, and picking the right format saves a manual cleanup step later.
Letter case of the result
- Uppercase gives 4B1DE792A03C55, the style many hardware vendors expect.
- Lowercase gives 4b1de792a03c55, the style most command-line tools print.
Stripping padding and adding a 0x prefix
The equals sign only tells a reader how long the last group is. Many systems omit it when the length is known, so a good converter accepts input with or without it. Ticking a 0x prefix option writes 0x4B1DE792A03C55, the format that source code and memory addresses usually need.
Case sensitivity of the input
The RFC defines capital-letter symbols only, yet many readers are case-insensitive and accept small letters too. Treat case sensitivity as a property of the receiving system and capitalise everything when in doubt.
Base32 Variants: RFC 4648, Base32hex and Crockford
Three popular alphabets share the name, and picking the wrong one is the most common reason a converted value looks wrong.
Standard RFC 4648 Base32
RFC 4648 is the default almost every authenticator, DNS and cloud tool uses. It uses A to Z and 2 to 7, with the equals sign as padding.
Base32hex and its extended hex alphabet
This variant swaps in the digits 0 to 9 and the letters A to V so that sorted encoded values keep the sort order of the original data. Reading it with the standard table gives garbage, so confirm the variant first.
Crockford’s Base32
This scheme removes the letters I, L, O and U to stay human-readable and adds an optional check symbol. It needs its own character mapping before the regrouping step.
Moving a Hardware Token Secret with an Online Base32 to Hex Tool
Dariusz, an IT administrator, is replacing a keycard reader that only accepts token secrets as 40 hex digits. His old authenticator export lists the secret as TQXED5YLNLJVRBA7L2T4HWICXZSHDIEN, 32 symbols with no equals signs.
Before pasting anything, he does the arithmetic from the formula: 32 symbols carry 160 bits, which is 20 octets and 40 hex digits. That matches the length the reader wants, so the secret looks intact. He enters the value, selects lowercase and no prefix, and presses convert.
The tool returns 9c2e41f70b6ad358841f5ea7c3d902be6471a08d. He counts 40 digits and sees the first octet is 9c, exactly what the first eight symbols (TQXED5YL) should produce. As a reverse check he runs the result through a hex to Base32 step and gets his original value back.
The result matters because RFC 4226 recommends a 160-bit shared secret, and this one meets it exactly, so no weaker secret is being loaded by accident. Had the output been 38 digits, he would have gone back to the export file and looked for a dropped symbol. Instead he loads the 40 digits into the reader, generates a code and compares it with the phone app. Both show the same six digits, so the base32 to hex conversion was correct and he can retire the old reader.
Online Base32 to Hex Tools vs Scripts
A browser page suits a one-off check, while a script suits hundreds of values. Whichever you use, the logic is the same: decode, then print.
Python and JavaScript libraries
In Python, the standard library does the work in two calls:
from base64 import b32decode
print(b32decode("JMO6PEVAHRKQ====").hex())In JavaScript, a small loop over the symbol list with bitwise operations does the same job, or you can pull in one of the many maintained libraries instead of writing your own.
Batch processing many values
Migration jobs often hold hundreds of secrets in one file. Reading it line by line, running the conversion on each value and writing one hex result per line keeps batch processing simple and makes any bad row easy to spot.
Using the converter step by step
- Paste the full Base32 encoded value into the input box.
- Choose uppercase or lowercase output and decide whether to add the prefix.
- Press the convert button to run the conversion.
- Copy the hex result and, if it matters, run the reverse check described below.
Where Base32 to Hex Conversion Is Used
The same step shows up in several everyday jobs, from account security to low-level debugging.
Authenticator seeds and two-step sign-in
A TOTP app shows its shared secret as Base32, but some servers store the seed as hex. Converting the secret keys lets you enrol the same account in both places, and authentication then produces identical codes.
Azure to Duo migrations
Exported Azure MFA files list each token as Base32, while Duo imports hex. A script that converts the secret column row by row finishes the move without re-enrolling every user.
QR codes and debugging
The text inside an authenticator QR code holds a Base32 value. Showing it in hex lets you compare it with a vendor sheet during troubleshooting, or check it against cryptographic test material. In cryptography generally, the exact data matters far more than how it is displayed.
Troubleshooting Base32 to Hex Tools
When a conversion fails or a converter returns something unexpected, the cause is nearly always one of three things.
Invalid character errors
Digits 0, 1, 8 and 9 and most punctuation are not in the standard character set. Remove spaces and line breaks, and check that all characters are capital letters or the digits 2 to 7, with no letter O typed as a zero.
Padding and bit boundary problems
A string whose length leaves a stray fifth of a block usually lost characters in a copy. Real padding counts are fixed: a single input byte gives six equals signs, while 2, 3 and 4 bytes give four, three and one. Any other count signals a bit boundary problem, so recopy the original.
Input validation and error handling
Good input validation rejects bad symbols before converting, and clear error handling tells you which position failed. For stubborn cases, run a known value through the tool as one of your test vectors.
Hex to Base32 Converter: Reverse Conversion
The opposite direction is just as common. A hex to base32 converter turns hex digits back into five-digit binary groups and pads the final block to eight symbols. Running a reverse conversion on your result is the quickest accuracy check: encode 4B1DE792A03C55 and you should get JMO6PEVAHRKQ==== back.
Security Considerations When You Convert Base32
To convert base32 secrets safely, remember that encoding is not protection. Anyone can reverse it with no key, so whoever holds the text holds the secret. Prefer a tool that runs fully in your browser, avoid pasting live production seeds into unknown sites, and clear your clipboard afterward.
Size and readability trade-offs
Seven bytes need 14 hex symbols, 12 unpadded Base32 symbols, or 10 Base64 symbols plus equals signs. Hex is the easiest to read, Base32 is the easiest to dictate, and Base64 is the most compact.