Hex to Text Converter

Decode hexadecimal into readable text, or encode text into hex, with a byte-by-byte breakdown showing code points, binary and decimal values. Everything runs locally in your browser.

Screen showing hexadecimal data in a terminal window

Photo by Michael Geiger on Unsplash

Hex to text conversion tool

Accepts spaces, commas, 0x prefixes and line breaks.

Edit either side — conversion runs in both directions.

Updated: 2 August 2026Read: 7 minMethod: Byte parsing + TextDecoderRuns: 100% in your browser

Key takeaways

  • Two hex digits always represent exactly one byte, because each digit encodes four bits.
  • Hex is a representation of bytes; the text you get back depends entirely on which character encoding you apply to those bytes.
  • Garbled output almost always means UTF-8 data is being decoded as Latin-1 rather than a corrupted file.

What hexadecimal actually is

Hexadecimal is a base-16 positional number system. Where decimal has ten digits (0–9) and binary has two (0 and 1), hex has sixteen: 0 1 2 3 4 5 6 7 8 9 A B C D E F. The letters A to F stand for the decimal values 10 to 15. Each hex digit therefore encodes exactly four bits, which is why a single byte — eight bits — is always written as exactly two hex digits, from 00 to FF.

That four-bits-per-digit relationship is the whole reason hexadecimal became the standard notation for raw data. Writing the byte 11010110 takes eight characters and is easy to miscount; writing it as D6 takes two and can be read at a glance. Converting between hex and binary requires no arithmetic at all, just a lookup of sixteen four-bit patterns, which you can find in our binary conversion chart.

Hex digit values

HexDecimalBinaryHexDecimalBinary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

How hex-to-text conversion works

Text is not stored as letters. It is stored as numbers, and those numbers are stored as bytes. Converting hex to text is therefore a three-step pipeline, and the middle step is where almost every bug lives.

  1. Parse hex into bytes. Every pair of hex digits becomes one byte with a value between 0 and 255. 48 becomes 72, 65 becomes 101, and so on. Separators, 0x prefixes and line breaks are ignored.
  2. Interpret the bytes with an encoding. The byte 72 means the letter H in ASCII, in UTF-8 and in Latin-1, because all three agree on the first 128 values. Above 127 they diverge sharply. The byte sequence C3 A9 is the single character é in UTF-8 but the two characters é in Latin-1.
  3. Render the resulting characters. Code points are mapped to glyphs by the font. A missing glyph shows as a box, which is a font problem, not an encoding problem.

Worked example. The hex string 48 65 6C 6C 6F parses to the bytes 72, 101, 108, 108, 111. Looked up in the ASCII table those are H, e, l, l, o. Reversing the process gives back exactly the same hex, because this conversion is lossless in both directions.

Choosing the right encoding

The tool offers three interpretations of the same bytes, and picking the wrong one is the single most common cause of garbled output.

EncodingBytes per characterCoversUse when
UTF-81–4All 1.1M Unicode code pointsDefault for the modern web, JSON, source code and APIs
ISO-8859-1 (Latin-1)Always 1256 Western European charactersLegacy databases, older HTTP headers, fixed-width records
UTF-16 BE2 or 4All Unicode via surrogate pairsWindows APIs, Java strings, some binary file formats

If output looks like é, ’ or a run of question marks, the bytes are almost certainly UTF-8 being read as Latin-1. Switch encoding rather than editing the data. Our character encoding guide works through the whole family of failure modes.

Where hex dumps show up in real work

  • Network debugging. Packet captures in Wireshark, tcpdump and curl’s --trace output are hex dumps. Decoding a payload by hand is often the fastest way to confirm what a client actually sent.
  • File format forensics. Every format starts with a magic number: 25 50 44 46 is %PDF, 89 50 4E 47 is a PNG, 50 4B 03 04 is a ZIP archive (and therefore also a .docx or .xlsx).
  • Embedded systems. Serial protocols, EEPROM dumps and firmware images are read as hex. Converting a region back to text quickly reveals version strings and configuration blobs.
  • Security analysis. Shellcode, obfuscated payloads and malware configuration are routinely hex-encoded to survive transport through text channels, much like Base64.
  • Databases. Binary columns are displayed as hex by MySQL, PostgreSQL (\x notation) and SQL Server, so decoding hex is a daily task when inspecting BLOB data.

Doing it in code

JavaScript

// hex string -> text (UTF-8)
const hexToText = hex =>
  new TextDecoder().decode(
    Uint8Array.from(hex.replace(/[^0-9a-f]/gi, '').match(/../g), b =>
      parseInt(b, 16))
  );

// text -> hex string
const textToHex = str =>
  [...new TextEncoder().encode(str)]
    .map(b => b.toString(16).padStart(2, '0'))
    .join(' ');

Python

bytes.fromhex('48656c6c6f').decode('utf-8')   # 'Hello'
'Hello'.encode('utf-8').hex(' ')                  # '48 65 6c 6c 6f'

Command line

echo -n 'Hello' | xxd -p        # 48656c6c6f
echo '48656c6c6f' | xxd -r -p   # Hello

Frequently Asked Questions

How do I convert hex to text?

Split the hex string into pairs of digits, convert each pair to a byte value between 0 and 255, then interpret those bytes with a character encoding — UTF-8 in almost all modern contexts. The converter above does all three steps as you type.

Why does my decoded text contain strange symbols?

The bytes are being read with the wrong encoding. Sequences such as C3 A9 are a single accented character in UTF-8 but two separate characters in Latin-1. Switch the encoding selector rather than editing the hex.

Is hex encoding the same as encryption?

No. Hexadecimal is a representation, not a secret. Anyone can convert it back with no key at all. See our guide on hashing versus encryption versus encoding for the distinction.

What does the 0x prefix mean?
0x is a source-code convention that tells a compiler or interpreter the number that follows is hexadecimal, so 0x1F is 31 in decimal. It is not part of the data and the tool strips it automatically.
How many hex digits does one character need?

It depends on the encoding. An ASCII letter is one byte, so two hex digits. An accented Latin character in UTF-8 is two bytes (four digits), most CJK characters are three bytes (six digits) and emoji are four bytes (eight digits).

Can I convert hex to binary instead?

Yes — the character breakdown table shows the binary for every byte, and the number system converter handles arbitrary base conversion with step-by-step working.

Is my data sent anywhere?

No. The conversion runs in JavaScript inside your browser tab. There is no upload, no logging and no analytics on the input. You can disconnect from the network and the tool keeps working.

Sources & further reading

  1. RFC 4648 — the base 16, 32 and 64 data encodings
  2. MDN: TextDecoder — the browser API used to turn bytes into text
  3. The Unicode Standard — authoritative definition of code points and encoding forms
  4. Wikipedia: Hexadecimal — history and notation conventions of base-16