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.
#ff8800describes 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.
Related tools
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.