Convert text to hex
Encode text as hexadecimal with a choice of separator, uppercase digits and 0x prefixes, plus a byte dump for any file you drop in.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
The converted value appears here.
Accents, CJK and emoji become multiple bytes each, exactly as they are stored on disk.
Applies to the generated output. Input is parsed with or without separators.
What you get
Type or paste text and every byte appears as two hex digits. The character-set switch decides what “byte” means: UTF-8, which is what files and networks actually carry, or single-byte Latin-1, which is what an old ASCII table describes.
Choosing an output format
| Format | Looks like | Use it for |
|---|---|---|
| Space-separated | 48 65 6c 6c 6f | Documentation, protocol notes, code review |
| Continuous | 48656c6c6f | Config values, API fields, checksum comparison |
| 0x prefixed | 0x48 0x65 0x6c | C, Python and shell literals |
| One per line | a column of pairs | Diffing two payloads side by side |
Counting bytes, not characters
The counter under the output is the figure that matters when a field has a byte limit — a
database VARCHAR, an SMS segment, a QR code payload, a DNS label. Under UTF-8:
- ASCII letters, digits and punctuation: 1 byte each.
- Latin accents, Greek, Cyrillic, Hebrew, Arabic: 2 bytes.
- Chinese, Japanese, Korean, most symbols: 3 bytes.
- Emoji and rarer scripts: 4 bytes — and composite emoji, several times that.
A 20-character name in Japanese is 60 bytes. A single family emoji can exceed 25. This is why “maximum 100 characters” and “maximum 100 bytes” are very different constraints.
Finding the invisible difference
The most common practical use of this page is comparing two strings that look identical but behave differently — a config value that will not match, a password that is rejected, a CSV column that will not join. Hex makes the difference visible immediately:
| Looks like | Actually is |
|---|---|
| a space | C2 A0 non-breaking space, not 20 |
| a hyphen | E2 80 93 en dash, not 2D |
| a quote | E2 80 9C smart quote, not 22 |
| nothing at all | EF BB BF BOM, or E2 80 8B zero-width space |
| a line break | 0D 0A rather than 0A |
Dumping a file
Drop a file into the panel below the converter to see its bytes. The first 512 KB are
shown, which is plenty for identifying a file header, checking for a BOM, or confirming where
a truncation happened. For a full dump of something large, xxd or a dedicated hex
editor is the right tool.
Hex is not encryption
Worth saying plainly, because it comes up: hex is a display format. Anyone can convert it back in one step, including on this page. Encoding a password or a token as hex stores it in plain text with an extra keystroke.
Questions
How many bytes will my text be?
In UTF-8, plain Latin letters are one byte each, most accented and Greek/Cyrillic letters are two, CJK is three, and emoji are four. The byte counter under the output shows the exact figure.
Which output format do I want?
Space-separated pairs read best in documentation; continuous hex is what most APIs and config files expect; the 0x prefix suits C, Python and shell literals. All three are one toggle apart.
Why does an emoji produce four bytes rather than two?
Most emoji live above U+FFFF, so UTF-8 needs four bytes. Some — flags, skin-tone variants, family groups — are several codepoints joined by zero-width joiners and produce far more.
Can I dump a binary file as hex?
Yes, drop it into the file panel. The first 512 KB are dumped so the page stays responsive; for anything larger, xxd or a hex editor is the better tool.