Skip to content
Case Converter Online
en

Hex to Text Converter

Paste hexadecimal bytes to read them as text, or type text to see its hex codes. Spaces, 0x prefixes and \x escapes are all understood.

Works both ways. Spaces, 0x, \x, colons and commas in the hex are ignored when decoding.

What hexadecimal is

Hexadecimal, or hex, is a base 16 number system. It uses the digits 0 to 9 and the letters A to F, where A means 10 and F means 15. Two hex digits can show any value from 0 to 255, which is exactly one byte. That makes hex a compact and readable way to show raw data.

You will find hex in memory dumps, network packet captures, file signatures, colour codes, escape sequences in source code and error logs. Turning those bytes back into text often tells you what the data says.

How to use the hex to text converter

Hex to text. Paste hex into the Hex box on the left. The decoded text appears in the Text box on the right. The converter ignores the usual separators, so you can paste:

  • spaced bytes: 48 65 6c 6c 6f
  • one long string: 48656c6c6f
  • C style prefixes: 0x48 0x65 0x6c
  • escape sequences: \x48\x65\x6c
  • colon or comma separated bytes: 48:65:6c:6c:6f

Text to hex. Type in the Text box on the right. The hex appears on the left.

Hex format controls how the hex is written:

  • Spaced: 48 65 6c for reading and comparing
  • Joined: 48656c for compact storage and hash style strings
  • Prefixed: 0x48 0x65 for C, C++ and similar code
  • Escaped: \x48\x65 for string literals in Python, JavaScript and shell scripts

Uppercase A to F writes the letters as capitals. Copy takes either box and Clear empties both.

How it works

To decode, the converter strips separators, checks that only hex digits remain and that there is an even number of them, then reads every pair of digits as one byte. The bytes are decoded as UTF-8 text. To encode, it does the opposite: text becomes UTF-8 bytes and each byte becomes two hex digits.

Each hex digit stands for 4 bits. The byte 48 is 4 × 16 + 8 = 72, which is the code for capital H.

Examples

Hex Text
41 A
48 69 21 Hi!
48 65 6c 6c 6f Hello
48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 Hello, World!
63 61 66 c3 a9 café
e2 82 ac €

The same text in each output format:

Format café
Spaced 63 61 66 c3 a9
Joined, upper case 636166C3A9
Prefixed 0x63 0x61 0x66 0xc3 0xa9
Escaped \x63\x61\x66\xc3\xa9

Common hex values

Hex Character Hex Character
20 space 30 0
0a new line 41 A
0d carriage return 61 a
09 tab 7e ~

Tips and limits

  • Garbage output usually means the data is not text. Images, compressed files and encrypted data turn into odd symbols and replacement characters. That is expected.
  • Check the byte order for numbers. This tool reads bytes in the order given. Multi-byte numbers in memory dumps are often stored little endian, so read them from right to left.
  • Hex colour codes are not text. #ff8800 describes red, green and blue levels, not letters.
  • Hex is not encryption. It is simply another way to write bytes.

Other ways to convert hex

Command line. On Linux and macOS, xxd -p turns a file into plain hex and xxd -r -p turns it back. echo -n Hello | xxd -p prints 48656c6c6f.

Python. bytes.fromhex('48656c6c6f').decode() returns Hello, and 'Hello'.encode().hex() returns 48656c6c6f.

JavaScript (Node). Buffer.from('48656c6c6f', 'hex').toString() returns Hello.

Excel. =CHAR(HEX2DEC("48")) returns H for single ASCII bytes. =DEC2HEX(72) goes the other way.

To see the same bytes as ones and zeros, use the binary code translator. The UTF-8 encoding tool shows each character with its code point and bytes. If your data is Base64 rather than hex, use the Base64 decoder.

Hex to Text: questions and answers

How do I convert hex to text?

Paste the hex into the Hex box on the left. The text appears on the right straight away. 48 65 6c 6c 6f, 48656c6c6f and 0x48 0x65 0x6c 0x6c 0x6f all decode to Hello.

Why do I get an odd number of digits error?

Every byte is written as exactly two hex digits, so valid hex always has an even number of digits once separators are removed. A missing or extra digit somewhere in the paste is the usual cause. Single-digit values must be written with a leading zero, such as 0a instead of a.

Is the output ASCII or UTF-8?

UTF-8, which includes ASCII. Plain English text gives the same hex in both. Characters beyond ASCII take more than one byte, so é is c3 a9 and the euro sign is e2 82 ac.

Does upper or lower case matter in hex?

No. 4F and 4f are the same byte. Turn on Uppercase A to F if the place you paste into expects capital letters.

More code and data tools

See all tools