100% local — your data never leaves your browser

Text to Hex — See the Invisible Character

Show text as its UTF-8 bytes in hexadecimal, space-separated. The byte count is usually the surprise, and the stray byte is usually the answer.

Instant Private Zero cookies

Text input

Hex output

What this tool does

The text is encoded as UTF-8, and each resulting byte is printed in lowercase hexadecimal, separated by a space.

The separation is deliberate: a run of digits is hard to read and easy to miscount, and the whole point of looking at hex is to count.

Bytes, not characters

This is the part that surprises people, and it is the reason the tool is useful:

hi      →  68 69              2 bytes,  2 characters
café    →  63 61 66 c3 a9     5 bytes,  4 characters
😀      →  f0 9f 98 80        4 bytes,  1 character

UTF-8 is variable width. An ASCII letter costs one byte, an accented Latin letter two, most CJK characters three, an emoji four. If a database column, a protocol field or a file format limits you to n bytes, this is the count that matters — not the one your editor shows.

What it makes visible

Everything that does not render. A trailing newline is 0a. A Windows line ending is 0d 0a, two bytes where you expected one. A non-breaking space that looks exactly like a space is c2 a0. A byte-order mark at the head of a file is ef bb bf.

Each of these has broken a comparison, a parser or an import somewhere, and none of them is visible in a text field.

Reading hex back

The reverse direction accepts spaces and uppercase, so you can paste output from a hex dump, a debugger or a log without cleaning it first.

An odd number of digits is an error rather than a guess: a byte is two digits, and there is no way to know which end is missing.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Why does my 4-letter word show 5 bytes?
Because UTF-8 is variable width. ASCII letters take one byte each, an accented letter takes two, most CJK characters take three, and an emoji takes four. The tool shows bytes, which is why the count differs from the character count.
Can I paste hex with spaces or capitals?
Yes, both. Spaces are ignored and `4A` reads the same as `4a`. What is refused is an odd number of digits: a byte is two digits, and guessing which end is missing would be worse than saying so.
Why is this useful for debugging?
Because it makes invisible things visible. A trailing newline, a non-breaking space, a byte-order mark, a Windows line ending — none of them show in a text field, and all of them show here.

Related converters