Tools

Text to Hex Converter

Convert text to hexadecimal bytes and back

Type in either box. Text is encoded as UTF-8.

How to convert text to hex

  1. Type or paste text in the Text box. Each UTF-8 byte is shown as two hexadecimal digits, for example Hi becomes 48 69.
  2. Choose a separator (space, none, comma or new line) and tick 0x prefix if you need C-style literals such as 0x48, 0x69.
  3. To decode, paste hex into the other box. Prefixes such as 0x and \x, spaces and commas are ignored, and a continuous string such as 48656c6c6f is split into pairs automatically.

Where hex shows up

Hexadecimal is the standard way to show raw bytes because two hex digits represent exactly one byte. You will see it in hex editors, network packet captures, database BLOB dumps, URL and string escape sequences, cryptographic keys and hashes, MAC addresses, and memory dumps in debuggers. Converting a suspicious string to hex is a quick way to spot invisible characters such as a zero-width space (e2 80 8b), a non-breaking space (c2 a0) or a Windows line ending (0d 0a).

Text is encoded as UTF-8, so non-English characters use two to four bytes: é is c3 a9 and the euro sign is e2 82 ac. When decoding, invalid UTF-8 sequences are flagged rather than silently mangled.

All conversion happens in your browser.

FAQ

What is "hello" in hex?

68 65 6c 6c 6f.

Is hex the same as Base64?

No. Both represent bytes as text, but hex uses 2 characters per byte while Base64 uses about 1.33, so Base64 is more compact.

Why is my hex upper case?

With spaces and no prefix, hex is shown in upper case for readability. Both cases decode the same.