Find your next tool

Browse tools or search by task

Explore JSONToonPro

Number Converter Tools

Text to Hex Converter – Convert Text to Hex Online

Convert text and Unicode characters to hexadecimal UTF-8 bytes online. Copy spaced or compact hex output instantly in your browser.

Runs locally in your browser. Nothing you paste is uploaded.

Text to Hex workspace
Text input
0 chars
Hex output
Result appears here...

How to Convert Text to Hexadecimal

Type text to view its UTF-8 bytes in hexadecimal. Choose spaced or compact output and copy it for a byte-oriented protocol or test fixture. This is text encoding rather than conversion of a decimal integer.

How Text Encoding Works

Hex uses two digits for each byte. UTF-8 determines which bytes represent a character. ASCII letters use one byte, while many symbols use several, so output length does not simply equal twice the visual character count.

Text to Hexadecimal Examples

A becomes 41, and Hi becomes 48 69. Multi-byte characters produce longer sequences. Preserve leading zeroes on byte values below hexadecimal 10 so a decoder can find byte boundaries.

Unicode, Spacing, and Input Rules

Spaced and compact byte strings carry the same bytes. A literal space in text has its own value, 20. Use Hex to Text for decoding and choose a different decoder if the source uses an encoding other than UTF-8.

More examples and technical details

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

How do I convert text to hexadecimal?

Enter text, choose spaced or compact output and copy the hex bytes.

Does the tool support Unicode and special characters?

Yes. Text is encoded as UTF-8 before conversion to hex.

What input format should I use?

Enter ordinary text; hexadecimal output uses two digits per byte.

Is any input uploaded to a server?

No. Input is processed in this browser tab and is not uploaded by the tool. Copy and download are actions you control; ordinary page analytics do not receive tool input.