JSONToonPro
Number tool

Text to Hex Converter

Convert any text or ASCII string into its hexadecimal byte representation using UTF-8 encoding, with optional spacing between bytes. Everything runs 100% client-side in your browser.

100% client sideInstant resultNo data sent
Text input
0 chars
Hex output
Result appears here...

How to Convert Text to Hex

Hexadecimal is the format you see whenever raw bytes need to be readable by a human: hex dumps, memory viewers, network packet captures, and file signatures all use it. Converting text to hex means writing each character code in base 16.

  1. Take each character of the text in order.
  2. Find its character code, for example C is 67 in ASCII.
  3. Convert that number to base 16. 67 divided by 16 is 4 remainder 3, giving 43.
  4. Write every byte as exactly two hex digits, padding with a leading zero if the value is below 16.
  5. Join the pairs together, optionally separated by spaces for readability.

Worked example: encoding "Code"

C = 67 = 43
o = 111 = 6F
d = 100 = 64
e = 101 = 65

"Code" = 43 6F 64 65

Why Hex Is the Standard for Raw Bytes

One hex digit represents exactly four bits, so a byte is always exactly two hex characters. That fixed width is what makes hex dumps line up in neat columns and makes byte offsets easy to count.

Binary would need eight characters per byte and decimal needs a variable one to three digits, which breaks alignment. Hex sits in the middle: compact, fixed width, and still easy to translate back to bits in your head once you know the sixteen digit patterns.

ASCII, Unicode, and UTF-8

ASCII is the original character encoding standard, finalised in 1963. It defines 128 characters: the English alphabet in both cases, the digits 0 to 9, common punctuation, and 33 non printing control codes such as tab, newline, and carriage return. Because 128 values fit in seven bits, every ASCII character fits comfortably inside a single byte.

ASCII covers English and almost nothing else, which is why Unicode exists. Unicode assigns a number, called a code point, to every character in every writing system, plus symbols and emoji. UTF-8 is the encoding that turns those code points into bytes, and it was designed so that the first 128 code points encode to exactly the same single bytes as ASCII. That backward compatibility is why plain English text looks identical in both.

The practical consequence for this tool: English letters, digits, and punctuation each produce one byte. Accented characters, Greek, Cyrillic, Arabic, and CJK characters produce two or three bytes each, and emoji usually produce four. The converter handles all of them correctly using UTF-8.

Details Worth Knowing

  • Hex is case insensitive for its letters. 4A and 4a are the same byte, though uppercase is the more common convention in dumps.
  • The 0x prefix is a programming language convention marking a hex literal. It is not part of the value itself.
  • Characters outside basic ASCII produce more than two hex digits, because UTF-8 encodes them across multiple bytes.

ASCII Conversion Table

Every printable ASCII character with its decimal code, hexadecimal byte, and binary byte. Codes 0 to 31 are control characters and are not printable, so they are not listed here.

CharDecHexBinary
space322000100000
!332100100001
"342200100010
#352300100011
$362400100100
%372500100101
&382600100110
'392700100111
(402800101000
)412900101001
*422A00101010
+432B00101011
,442C00101100
-452D00101101
.462E00101110
/472F00101111
0483000110000
1493100110001
2503200110010
3513300110011
4523400110100
5533500110101
6543600110110
7553700110111
CharDecHexBinary
8563800111000
9573900111001
:583A00111010
;593B00111011
<603C00111100
=613D00111101
>623E00111110
?633F00111111
@644001000000
A654101000001
B664201000010
C674301000011
D684401000100
E694501000101
F704601000110
G714701000111
H724801001000
I734901001001
J744A01001010
K754B01001011
L764C01001100
M774D01001101
N784E01001110
O794F01001111
CharDecHexBinary
P805001010000
Q815101010001
R825201010010
S835301010011
T845401010100
U855501010101
V865601010110
W875701010111
X885801011000
Y895901011001
Z905A01011010
[915B01011011
\925C01011100
]935D01011101
^945E01011110
_955F01011111
`966001100000
a976101100001
b986201100010
c996301100011
d1006401100100
e1016501100101
f1026601100110
g1036701100111
CharDecHexBinary
h1046801101000
i1056901101001
j1066A01101010
k1076B01101011
l1086C01101100
m1096D01101101
n1106E01101110
o1116F01101111
p1127001110000
q1137101110001
r1147201110010
s1157301110011
t1167401110100
u1177501110101
v1187601110110
w1197701110111
x1207801111000
y1217901111001
z1227A01111010
{1237B01111011
|1247C01111100
}1257D01111101
~1267E01111110

Looking for a different conversion? Browse every developer tool including binary, hex, octal, and Base64 converters.

Frequently asked questions

4 answers
Each character in your text is first turned into its UTF-8 byte value, then that byte is written in base 16 (hexadecimal) as a two-digit pair. For example, a capital A has the byte value 65 in decimal, which is 41 in hex. The converter walks through your string character by character, encoding each one and joining the results, with optional spaces between bytes for readability.

More JSON Tools

About the Text to Hex Converter

Hexadecimal is the developer's shorthand for raw bytes, and turning text into hex is a common step when debugging encodings, building protocol messages, or embedding literal byte values in code. This converter encodes your input as UTF-8 and prints each byte as a two-digit hex pair, with an option to space the bytes apart for easy reading. Multi-byte characters such as accented letters and emoji expand naturally into several pairs, so the output matches exactly what a UTF-8 system stores. Everything is computed locally in your browser, which means even sensitive strings never leave your device.