Text to Hex Converter

Text to hexadecimal bytes and hex back to text, UTF-8.

How do you convert text to hexadecimal?

Encode the text as bytes (UTF-8), then write each byte as two hex digits. "Hello" is the bytes 72, 101, 108, 108, 111, which in hex are 48 65 6C 6C 6F. Each hex digit stands for 4 bits, so one byte is always exactly two digits (00–FF).

Hex table for letters and digits

CharHexCharHexCharHex
A41a61030
B42b62131
C43c63232
D44d64333
E45e65434
F46f66535
G47g67636
H48h68737
I49i69838
J4Aj6A939
K4Bk6BSpace20
L4Cl6C.2E
M4Dm6D,2C
N4En6E!21
O4Fo6F?3F
P50p70
Q51q71
R52r72
S53s73
T54t74
U55u75
V56v76
W57w77
X58x78
Y59y79
Z5Az7A

Text to hex in Python, JavaScript and Excel

WhereText → hexHex → text
Python"Hello".encode().hex()bytes.fromhex("48656c6c6f").decode()
JavaScript[...new TextEncoder().encode(s)].map(b=>b.toString(16).padStart(2,"0")).join("")new TextDecoder().decode(Uint8Array.from(h.match(/../g),x=>parseInt(x,16)))
Excel=DEC2HEX(UNICODE(A1)) per character=UNICHAR(HEX2DEC("48"))

Excel's UNICODE returns the code point, which equals the UTF-8 byte only for ASCII characters.

Hex to text: which formats are accepted?

Pairs with spaces (48 65), one continuous string (4865), C-style 0x48 0x65, and escaped \x48\x65. Commas and colons are ignored.

Why do some characters become 2–4 hex bytes?

UTF-8 stores characters beyond ASCII in several bytes: "é" is C3 A9, "한" is ED 95 9C, and "😀" is F0 9F 98 80.

Sources: RFC 3629 (UTF-8) · Microsoft Support, UNICODE function. Checked October 2026.

Frequently asked questions

What is "Hello" in hex?

48 65 6C 6C 6F (or 48656c6c6f without spaces).

Is hex the same as ASCII?

For basic ASCII characters the hex value is the ASCII code written in base 16: A is 65 decimal = 41 hex. For other characters this converter uses UTF-8 bytes.

Should hex be upper or lower case?

Both mean the same. Lower case is common in programming output; tick Upper case if you need 4F rather than 4f.

Can I convert hex numbers to decimal here?

For numbers, use the number base converter. This page treats hex as bytes of text.