Hex to Base64 Converter

Type Hex and get Base64 instantly — with every other encoding shown at the same time.

Edit any pane and the others update. Handles UTF-8 correctly — "é" is two bytes, which many quick converters get wrong.

How to convert Hex to Base64

Hex and Base64 both describe raw bytes, just with different alphabets: hex uses two characters per byte (4 bits each), Base64 uses four characters per three bytes (6 bits each). To convert, the hex digits are first paired back into bytes, then those bytes are regrouped into 6-bit chunks and read off the Base64 alphabet. Because the group sizes differ, a partial final group produces the familiar = padding.

Worked example

Take the four bytes de ad be ef.

  1. As 32 bits: 11011110 10101101 10111110 11101111.
  2. Regroup into 6-bit values (the last group is short, so it is zero-padded): 110111 101010 110110 111110 111011 11.
  3. 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

ValueCharacter
0A
1B
2C
3D
4E
5F
6G
7H
8I
9J
10K
11L
12M
13N
14O
15P
16Q
17R
18S
19T
20U
21V
22W
23X
24Y
25Z
26a
27b
28c
29d
30e
31f
32g
33h
34i
35j
36k
37l
38m
39n
40o
41p
42q
43r
44s
45t
46u
47v
48w
49x
50y
51z
520
531
542
553
564
575
586
597
608
619
62+
63/

Frequently asked questions

How do I convert Base64 back to Hex?
Use the Base64 to Hex 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.