Text to hex
Turn text into hex bytes in UTF-8, UTF-16, EUC-KR or ASCII, spaced as you like.
Result
More octal, code points
Settings
Recent
Text becomes hex by encoding each character into bytes and writing every byte as two hex digits. Type a word and you get its UTF-8 bytes by default, or switch to UTF-16, EUC-KR or ASCII; separators such as spaces, commas, 0x or \x are one click away. Free, with no account.
How to do it by hand
- Pick the encoding. UTF-8 is the usual choice for web pages and files.
- Look up the code point of each character, for example A is U+0041.
- Encode it: in UTF-8, A is the single byte 41, while 가 takes three bytes, EA B0 80.
- Write each byte as two hex digits and put your chosen separator between them.
Worked examples
Hi
H = 72 = 48, i = 105 = 69
48 69
é (UTF-8)
U+00E9 needs two bytes in UTF-8
C3 A9
한 (UTF-8)
U+D55C needs three bytes in UTF-8
ED 95 9C
Common mistakes
- Expecting one byte per character. Only ASCII is one byte in UTF-8; accented letters take two and Korean takes three.
- Comparing hex from different encodings. 가 is EA B0 80 in UTF-8 but B0 A1 in EUC-KR.
- Missing invisible characters. A trailing space adds 20 and a line break adds 0A.
UTF-8 and UTF-16 bytes per character
| Character | Unicode | UTF-8 | UTF-16 BE |
|---|---|---|---|
| A | U+0041 | 41 | 00 41 |
| z | U+007A | 7A | 00 7A |
| 0 | U+0030 | 30 | 00 30 |
| (space) | U+0020 | 20 | 00 20 |
| ~ | U+007E | 7E | 00 7E |
| é | U+00E9 | C3 A9 | 00 E9 |
| ß | U+00DF | C3 9F | 00 DF |
| € | U+20AC | E2 82 AC | 20 AC |
| 가 | U+AC00 | EA B0 80 | AC 00 |
| 한 | U+D55C | ED 95 9C | D5 5C |
| 😀 | U+1F600 | F0 9F 98 80 | D8 3D DE 00 |
Questions people ask
Why does one Korean syllable turn into six hex digits?
In UTF-8 a Korean syllable takes three bytes, and each byte is written as two hex digits.
What happens to characters ASCII cannot hold?
They are marked in the result together with the reason, so you can see exactly which ones did not fit.
Can I get C-style \x41 output?
Yes. Choose \x as the separator and every byte is written as \x followed by two hex digits.