Skip to main content
Byte Array Tools

Text to Hex Converter

Convert text to hexadecimal and hex back to text, in UTF-8, UTF-16 or Latin-1, with a choice of separators and letter case.

Type in either box: text turns into hex as you type, and hex turns back into text.

ASCII characters are one byte in UTF-8, but accented letters, symbols and emoji take two to four - so the hex is longer than the text.

What Is the Text to Hex Converter?

It converts text into hexadecimal - two hex digits for every byte of the text - and converts hex back into text. Type in either box and the other updates. You can choose UTF-8, UTF-16 or Latin-1, the separator between bytes and upper or lower case.

When to Use It

  • Checking exactly which bytes a string contains, including invisible characters.
  • Reading hex from a log, a URL, a database dump or a protocol trace.
  • Preparing hex for a test, a command-line tool or a hardware device.

How to Use It

  1. Type text in the left box to get hex, or paste hex in the right box to get text.
  2. Choose the encoding, separator and case.
  3. Copy the hex with the Copy button.

Example

Byteary: bytes made easy ✓ with a colon separator becomes 42:79:74:65:61:72:79:3A:20:62:79:74:65:73:20:6D:61:64:65:20:65:61:73:79:20:E2:9C:93. Every letter is one byte, but the check mark takes three: E2 9C 93. Going the other way, 48 69 21 is Hi!.

Understanding the Output

For plain English text, UTF-8, Latin-1 and ASCII give the same hex. The difference appears with accented letters, other scripts and emoji. In UTF-16 every character takes at least two bytes, so the hex is twice as long.

Limitations

If the hex is not valid in the chosen encoding, the text shows � characters. For code arrays instead of a hex string, use the String to Byte Array Converter; for percent-encoding in URLs, use the URL Encoder / Decoder.

Frequently Asked Questions

Two hex digits are one byte. In UTF-8, characters outside ASCII take two to four bytes, so an accented letter becomes four hex digits and an emoji eight.

For plain English text there is none - UTF-8 and ASCII give the same bytes. The difference appears only with characters outside ASCII, which ASCII cannot represent at all. UTF-8 is the safe default.

Yes. When converting hex to text, spaces, colons, dashes, commas and 0x or \x prefixes are ignored. Only the hex digits matter, and there must be an even number of them.
Share this tool: