How to convert Base64 to Hex
Converting Base64 to hex goes through the underlying bytes: each group of four Base64 characters becomes three bytes, and each byte is then written as two hexadecimal digits. The result is a plain hex dump of exactly the same data the Base64 string encoded.
Worked example
Take the four bytes de ad be ef.
- As 32 bits:
11011110 10101101 10111110 11101111. - Regroup into 6-bit values (the last group is short, so it is zero-padded):
110111 101010 110110 111110 111011 11. - Reading off the alphabet gives
3q2+7w==— the two=signs mark the padding of that short final group.
Decoding runs the same steps backwards, recovering the original four bytes exactly.
The Base64 alphabet
| Value | Character |
|---|---|
| 0 | A |
| 1 | B |
| 2 | C |
| 3 | D |
| 4 | E |
| 5 | F |
| 6 | G |
| 7 | H |
| 8 | I |
| 9 | J |
| 10 | K |
| 11 | L |
| 12 | M |
| 13 | N |
| 14 | O |
| 15 | P |
| 16 | Q |
| 17 | R |
| 18 | S |
| 19 | T |
| 20 | U |
| 21 | V |
| 22 | W |
| 23 | X |
| 24 | Y |
| 25 | Z |
| 26 | a |
| 27 | b |
| 28 | c |
| 29 | d |
| 30 | e |
| 31 | f |
| 32 | g |
| 33 | h |
| 34 | i |
| 35 | j |
| 36 | k |
| 37 | l |
| 38 | m |
| 39 | n |
| 40 | o |
| 41 | p |
| 42 | q |
| 43 | r |
| 44 | s |
| 45 | t |
| 46 | u |
| 47 | v |
| 48 | w |
| 49 | x |
| 50 | y |
| 51 | z |
| 52 | 0 |
| 53 | 1 |
| 54 | 2 |
| 55 | 3 |
| 56 | 4 |
| 57 | 5 |
| 58 | 6 |
| 59 | 7 |
| 60 | 8 |
| 61 | 9 |
| 62 | + |
| 63 | / |
Frequently asked questions
- How do I convert Hex back to Base64?
- Use the Hex to Base64 converter, or just type into the matching pane above — every pane is editable and the others update to match.
- Is my data sent to a server?
- No. All encoding and decoding happens in your browser, so you can safely convert tokens, keys, or anything else sensitive.
- Does this handle non-ASCII text?
- Yes. Text is encoded as UTF-8, so accented letters, emoji, and non-Latin scripts convert correctly — the hex pane always shows you the exact bytes.