Tools
EN

Text to Hex Converter

Type or paste text to see its bytes in hexadecimal. Choose the encoding, letter case and separator – from plain 48656C6C6F to C-style 0x48, 0x65 or \x48\x65 escapes.

Private: your data is processed in your browser and never uploaded.

How to convert text to hex

  1. Type or paste your text. Every language and emoji is supported.
  2. Choose the character encoding (UTF-8 is the standard), the letter case and how the bytes are separated. Tick New line every 16 bytes for a hex-dump layout.
  3. Copy the hex string or download it as a text file.

How text is converted to hex

Computers store text as bytes. The converter looks up the byte value of each character in the chosen encoding and writes it as two hex digits. In ASCII and UTF-8, A is 65 = 41, a is 97 = 61 and a space is 32 = 20, so “Hi!” becomes 48 69 21.

CharacterDecimalHex
A … Z65 … 9041 … 5A
a … z97 … 12261 … 7A
0 … 948 … 5730 … 39
Space3220
!3321
New line100A

UTF-8, Latin-1 and UTF-16 compared

The same character can produce different bytes depending on the encoding. UTF-8 is the right choice for the web, JSON and most files; use another encoding only when the receiving system expects it.

TextUTF-8Windows-1252UTF-16 LE
A414141 00
éC3 A9E9E9 00
€E2 82 AC80AC 20
😀F0 9F 98 80not available3D D8 00 DE

String to hex in code

Frequently asked questions

Is text to hex the same as ASCII to hex?

For English letters, digits and punctuation, yes: ASCII and UTF-8 produce the same bytes. Characters such as é, ß, Ж, 中 or emoji are not part of ASCII; UTF-8 encodes each of them as 2–4 bytes.

Why does one character produce several hex bytes?

In UTF-8 only ASCII characters take a single byte. é becomes C3 A9, € becomes E2 82 AC and most emoji take four bytes. Choose UTF-16 or Latin-1 if the target system expects those encodings.

Which separator should I use?

None for hashes and compact strings, spaces for readable hex dumps, colons for MAC addresses and certificate fingerprints, 0x48, 0x65 for arrays in C, C# or Java, and \x48 for string literals in C, Python or shell scripts.

How do I turn the hex back into text?

Press Swap: the hex moves to the input and is decoded with the same encoding. The decoder accepts every separator offered here.