ToolLineup

Text to Hex Converter

This text to hex converter shows the UTF-8 bytes behind your text in hexadecimal and turns hex back into readable text. Hex is the standard way to look at raw bytes because every byte is exactly two characters, which keeps a dump aligned in a way decimal never manages. The text is encoded as UTF-8 first, so every alphabet is handled correctly: an accented letter is two bytes, most CJK characters three, an emoji four. If a decode comes back with an invalid UTF-8 error, that is genuinely useful information — it means the bytes are in the wrong order, incomplete, or were never text in the first place.

How it works

Converts text to hexadecimal bytes and back, encoding as UTF-8 first so every alphabet works. Hex is the usual way to look at raw bytes because each byte is exactly two characters, which keeps a dump aligned.

If a decode fails with an invalid UTF-8 error, the bytes are either in the wrong order or incomplete — a good sign that the data was truncated or is not text at all.

Everything runs in your browser — nothing you paste is sent to a server.

Input
Paste text, or hex such as 48 65 6C 6C 6F…
Result

Why hex is the default for bytes

One hex character represents exactly four bits, so a byte is always two characters. That fixed width is what makes a hex dump readable — every byte occupies the same space and the columns line up, which is never true of decimal.

Reading a hex dump

A few byte values are worth recognising on sight:

  • 20 — a space. Long runs of them mean padding.
  • 0A and 0D — line feed and carriage return. A 0D 0A pair means Windows line endings.
  • EF BB BF — a UTF-8 byte order mark at the start of a file.
  • C3 followed by something — the first byte of a two-byte UTF-8 sequence, so an accented letter.
  • 00 — a null. In a text file, usually a sign the data is UTF-16 or not text at all.

When decoding fails

UTF-8 is self-validating: the leading bits of each byte say how many bytes the character occupies. A sequence that breaks those rules is genuinely invalid, so a failed decode is a real finding rather than a limitation of the tool.

Frequently asked questions

How do I convert text to hex?

Paste your text into the left panel with the direction set to hex. Each byte appears as two hexadecimal characters.

Why hexadecimal rather than decimal?

Every byte is exactly two hex characters, so a dump stays aligned and each character maps to exactly four bits. Decimal bytes vary between one and three digits and align badly.

Are multi-byte characters handled?

Yes. Text is encoded as UTF-8 first, so é is C3 A9 and an emoji is four bytes. Converting character by character would get all of these wrong.

What does an invalid UTF-8 error mean?

The bytes do not form valid UTF-8. Usually they are in the wrong order, some are missing, or the data was never text — all of which are useful things to learn.

Can I paste hex with 0x prefixes?

Yes. Prefixes and separators are stripped before decoding, so 0x48 0x69, 48 69 and 4869 all work.

Is my data uploaded?

No. Everything runs in your browser.

Related tools