Tools
Log in
English

All converters

Text to hex

Turn text into hex bytes in UTF-8, UTF-16, EUC-KR or ASCII, spaced as you like.

Result

Hex
Binary
Decimal
Unicode
More octal, code points
Octal
Code points (decimal)

Settings

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

  1. Pick the encoding. UTF-8 is the usual choice for web pages and files.
  2. Look up the code point of each character, for example A is U+0041.
  3. Encode it: in UTF-8, A is the single byte 41, while 가 takes three bytes, EA B0 80.
  4. 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

CharacterUnicodeUTF-8UTF-16 BE
AU+00414100 41
zU+007A7A00 7A
0U+00303000 30
(space)U+00202000 20
~U+007E7E00 7E
éU+00E9C3 A900 E9
ßU+00DFC3 9F00 DF
€U+20ACE2 82 AC20 AC
가U+AC00EA B0 80AC 00
한U+D55CED 95 9CD5 5C
😀U+1F600F0 9F 98 80D8 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.