Skip to content

Hex converter

Free, no sign-up Runs in your browser

Convert text to hexadecimal and hex back to text as UTF-8, with space, colon, 0x or \x separators and a hex dump view of the bytes. Runs in your browser.

Direction

Text is turned into its UTF-8 bytes, so a character outside ASCII becomes two to four bytes.

Hex
The result appears here.
Hex dump
Offsets, bytes and printable characters appear here.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the hex converter

  1. Choose text to hex, or hex to text.
  2. When encoding, pick a separator and the letter case.
  3. Paste the input. Hex is accepted with spaces, colons, commas, 0x or \x.
  4. Copy the result, or read the hex dump to inspect the bytes.

About this tool

Hexadecimal writes each byte as two digits from 0 to f. It is how bytes are shown when they have to be read by people: hashes, keys, packet captures, memory dumps, the escapes in a log line. Converting between text and hex answers practical questions, such as which bytes a string really holds, or what the readable part of a blob is.

Text has to become bytes first, and this tool uses UTF-8, the encoding of the web. Letters and digits in ASCII are one byte each, so "A" is 41. Other characters take two to four bytes: é is c3 a9 and an emoji is four. That is why the hex of a string can be longer than twice its character count, and why hex that decodes to gibberish may be valid data in another encoding or no text at all.

The hex dump shows the same bytes the way hexdump -C and xxd do: an offset, sixteen bytes per row, and the printable ASCII on the right with a dot for everything else. Use it to spot what a plain conversion hides: a trailing newline, a null byte, a byte order mark, or an invisible character that makes two strings that look equal compare as different.

Sources

Questions

How do I convert text to hex?

Encode the text as bytes, normally in UTF-8, and write each byte as two hexadecimal digits. "Hi" is the bytes 72 and 105, which are 48 and 69 in hex, so the result is 4869.

Why does one character become several hex bytes?

UTF-8 uses one byte for ASCII and two to four for everything else. An accented letter is usually two bytes, most Asian characters three, and emoji four.

Is hex encoding a form of encryption?

No. Hex is a way of writing bytes and anyone can reverse it. A password or key shown in hex is exactly as exposed as the original.

What is a hex dump?

A view of binary data in rows: the position of the row, the bytes in hex, and the same bytes as ASCII characters where they are printable. It lets you see both the exact bytes and any readable text among them.

Related tools