About the Hex to Text Converter
Logs, packet captures, database dumps and debugging tools often show data as hexadecimal bytes. This hex to text converter decodes them back into readable UTF-8 text, accepting bytes separated by spaces, colons, commas or line breaks, run together, or written with 0x prefixes: 48 65 6C 6C 6F reads Hello. Invalid characters and incomplete bytes are reported with their position, so you can find mistakes quickly in long dumps.
Each pair of hexadecimal digits is one byte from 00 to FF, worth the first digit × 16 plus the second, so 48 is 72, the code for H. After the prefixes and separators are removed, the digits are read two at a time; an odd number of digits means a byte is incomplete, which the converter flags. If the bytes are not valid UTF-8, for example data from an older system, they are shown as Latin-1 instead, one character per byte, with a note.
Example: 48 65 6C 6C 6F decodes to Hello, 0x48,0x69 to Hi, and \x48\x69 to Hi as well. C3 A9 decodes to é.
To encode text as hex use the text to hex converter. For binary digits use the binary to text converter, for decimal codes the ASCII to text converter, and for single numbers the hex to decimal converter.
How to use the Hex to Text Converter
- Paste the hexBytes in any format: 48 65, 0x48 0x65, \x48\x65 or 4865.
- Read the textDecoded as UTF-8 as you type.
- Check for errorsInvalid characters and odd digit counts are pointed out.
- Copy the resultCopy or download the decoded text.
Hex to Text Converter features
- Any separator or none
- 0x and \x prefixes, even mixed
- UTF-8 decoding for every language
- Latin-1 fallback for legacy bytes
- Error positions for invalid hex
- Byte and character counts
- Runs in your browser
Common uses
- Reading hex dumps and logs
- Decoding network and serial data
- Database and firmware debugging
- Capture-the-flag puzzles
- Checking encoder output
Hex to text in practice: reading a network capture, identifying files by their first bytes, double-encoded text, UTF-16 and suspicious code
Hex dumps are how tools show raw data: network captures, database fields, memory, files and encoded strings in code. Decoding them back to text reveals what the data says. This guide reads a captured web request, identifies files from their opening bytes, diagnoses doubly encoded text, recognises UTF-16 and decodes the hex escapes often used to hide suspicious code.
A worked example: a network capture
A packet capture shows the bytes 47 45 54 20 2F 20 48 54 54 50 2F 31 2E 31. Decoding them gives GET / HTTP/1.1, the first line of a web request. Reading captures this way shows exactly what a device or app sent, which helps when debugging an API client or a smart device that refuses to connect.
Identifying files by their first bytes
Most file formats start with a fixed signature. PDF files begin 25 50 44 46, which decodes to %PDF. ZIP archives, including Word and Excel files, begin 50 4B 03 04, starting with PK. JPEG images begin FF D8 FF and PNG images 89 50 4E 47. Checking the first bytes identifies a file whose extension is missing or wrong, such as an attachment that will not open.
Doubly encoded text
When text is encoded as UTF-8 twice, each accented or Urdu character becomes four or more bytes of nonsense. The letter é, correctly C3 A9, becomes C3 83 C2 A9 after double encoding and displays as é. Seeing this pattern in a database's hex output confirms the problem lies in a connection or import step that encodes already-encoded text.
UTF-16 text
Text exported by some Windows tools is in UTF-16, where each basic letter takes two bytes with a zero byte alongside, so Hi appears as 48 00 69 00. Decoding that as UTF-8 produces letters separated by invisible null characters. Alternating 00 bytes are the giveaway, and converting the file to UTF-8 before processing solves the problem.
Suspicious code
Malicious scripts injected into websites often hide their strings as hex escapes, such as sequences of \x followed by two digits, to avoid detection by simple searches. Decoding them reveals addresses, function names and commands. If you find such code in your own site's files, treat it as a compromise and clean the site thoroughly.
Database values
Databases can return text and binary fields as hex, for example through MySQL's HEX function. Decoding the output shows exactly what is stored, including invisible characters, trailing spaces and the precise bytes of Urdu text, which is invaluable when two values that look equal refuse to match.
Cleaning input
Hex copied from tools may include offsets, ASCII columns and line numbers alongside the bytes. Remove these before decoding, keeping only the byte pairs. An odd number of hex digits means a digit was lost or an extra one included, usually at a line break.
Endianness and numbers
Not every hex dump contains text. Numbers stored in binary form decode to strange characters if treated as text. If part of a dump decodes to readable words and part to symbols, the symbols are likely numbers, lengths or flags, best read with a hex-to-decimal conversion instead.
Common mistakes
- Treating UTF-16 data as UTF-8.
- Trusting file extensions instead of file signatures.
- Decoding offsets and line numbers along with the bytes.
- Reading binary numbers as if they were text.
Related tools
To encode text as hex, use Text to Hex Converter. For numeric values in a dump, try Hex to Decimal Converter, and for Base64 blocks, Base64 Decoder.
Encrypted traffic looks random
Packet capture tools can follow a conversation and show it as text, but only for unencrypted protocols. HTTPS traffic decodes to random-looking bytes, because it is encrypted. Seeing readable text in a capture of a login or payment means the data travelled unprotected, which is worth fixing immediately.
Quoted-printable email
Emails sometimes use quoted-printable encoding, which writes non-ASCII bytes as an equals sign followed by two hex digits, so é appears as =C3=A9. Removing the equals signs and decoding the hex pairs reveals the original characters, which helps when reading raw email source or debugging newsletters.
Device protocols
Many devices exchange frames of bytes in which some fields are text, such as device names or serial numbers, and others are numbers, such as lengths and checksums. Decode only the text fields and interpret the rest as numbers, following the protocol documentation.
Keep the original
When investigating a problem or an incident, keep the original hex alongside the decoded text. Decoding can hide control characters, invisible spaces and invalid bytes, and the original is the only reliable record of exactly what was stored or sent.
Removing prefixes and escapes
Hex copied from source code often comes as 0x48, 0x69 or as \x48\x69. The converter accepts these forms, but when using other tools, strip the prefixes, commas and backslashes first, leaving only the pairs of digits, so nothing is mistaken for part of a byte.
Privacy
Decoding runs in your browser. Nothing you paste is uploaded or stored.
Frequently asked questions
How do I convert hex to text?
Take the hex two digits at a time, convert each pair to a byte value and decode the bytes as UTF-8 text. 48 65 6C 6C 6F becomes Hello. Paste the hex here to do it instantly.
Does it matter how the hex is separated?
No. Spaces, colons, commas, dashes and line breaks are all ignored, and so are 0x and \x prefixes. Hex with no separators at all is read two digits at a time.
Why do I get an odd number of digits error?
Every byte needs exactly two hex digits. A missing or extra digit usually comes from copying part of a line; check the start and end of the data.
What if the text comes out garbled?
The bytes may use an older encoding such as Windows-1252, or they may not be text at all, such as an image or compressed data. Only bytes that encode text produce readable output.
What is the hex for the letter A?
41 for uppercase A and 61 for lowercase a. Digits 0 to 9 are 30 to 39, and a space is 20. Paste 41 61 here and it decodes to Aa, a quick way to check a single value.
Is hex to ASCII the same as hex to text?
For English text, yes: ASCII characters are single bytes with the same values in UTF-8. This converter also handles characters outside ASCII. Bytes that are not valid UTF-8 fall back to Latin-1, one character per byte.
How do I decode hex in Python?
Use bytes.fromhex("48 65 6c 6c 6f").decode("utf-8"). In JavaScript, parse each pair with parseInt(pair, 16) and decode the bytes with TextDecoder.
Is my data private?
Yes. The decoding runs in your browser, so the hex you paste is never uploaded. It is not stored or logged, and the page keeps working offline once loaded, so it is safe for confidential data.
What does 0x mean before a hex number?
It is a prefix that marks a number as hexadecimal in C, JavaScript, Python and many other languages, so 0x48 means hex 48, which is 72 in decimal. The converter removes these prefixes automatically before decoding.