toolqik

88 · Encode & Convert

Text to Hex

Convert text to hexadecimal bytes, UTF-8 aware, with separator and prefix options.

Runs in your browser
Values are
Separator
Format
Result

  

About this tool

Convert any text to hexadecimal bytes. Hello becomes 48 65 6C 6C 6F. Hex is the usual way to inspect exactly what bytes a string contains: to spot hidden characters, compare encodings, write byte arrays or escape sequences in code, or prepare data for protocols and hardware.

Options

  • Separator: spaces (readable), none (48656C6C6F, compact), commas (for arrays) or one byte per line.
  • Prefix: 0x48, 0x65… for C, Java or Python byte arrays.
  • Uppercase or lowercase digits; both mean the same.
  • UTF-8 bytes (default) or Unicode code points (one hex number per character, e.g. E9 for é, 1F44B for 👋).

UTF-8 bytes or code points?

Computers store text as bytes, usually in UTF-8: English letters take one byte each (the same values as ASCII), while é takes two bytes (C3 A9) and most emoji four (👋 = F0 9F 91 8B). Choose UTF-8 bytes to see or decode the real bytes, as in files, network packets and hex dumps. Unicode code points gives one number per character instead (é = 233, 👋 = 128075). ASCII only rejects anything outside the 128 ASCII characters.

In code

// JavaScript
[...new TextEncoder().encode(text)].map(b => b.toString(16).padStart(2, '0')).join(' ')

# Python
text.encode('utf-8').hex(' ')

# Command line
printf 'Hello' | xxd -p

FAQ

How do I convert text to hex?

Type or paste the text. Each UTF-8 byte is shown as two hex digits, separated by spaces by default.

What is “Hello” in hex?

48 65 6C 6C 6F.

Why does é become two hex bytes?

In UTF-8, é is stored as two bytes, C3 A9. Choose “Unicode code points” to get its single code point E9 instead.

How do I get hex without spaces?

Choose “None” as the separator: 48656C6C6F.

esc
↑↓ navigate↵ open