Skip to content
Hex Calculator

Hexadecimal Escape Decoder

Decode \xHH escape sequences — copied from source code, a log, or a regex — back into readable text, multi-byte characters included.

Decoded text
Hi
Swapnil Sanghvi

Built by

Swapnil Sanghvi

Full-Stack Web Developer & WordPress Developer

Swapnil Sanghvi is a full-stack web and WordPress developer, UI designer, and full-time freelancer who builds and maintains Hex Calculator.

Hexadecimal Escape Decoder tool preview card from Hex Calculator
Share preview: this is the card that appears when you share the Hexadecimal Escape Decoder page on social media.

Further reading: Character encoding — Wikipedia

How to Decode Hex Escape Sequences

Extract every \x escape and its 2 hex digits, treat each as one byte, then decode the full sequence of bytes as UTF-8 text — reversing exactly what a hex escape converter does when encoding text into a string literal.

Where This Decoder Actually Comes Up

Reading a Python repr() String

When Python prints a string containing non-printable bytes, it shows them as \xHH escapes — pasting that portion here reveals what the original data actually was.

\x48\x69 -> Hi

Decoding a WAF or Regex Rule's Escaped Payload

Security rules and log entries often escape suspicious byte sequences as \xHH to keep them safely printable — decoding lets you see what the flagged input actually contained.

\x41 -> A

Untangling a Garbled Log Line

When a log line shows a run of \xHH escapes instead of readable text, decoding it here is faster than writing a one-off script just to check what got logged.

\x48\x65\x6c\x6c\x6f -> Hello

Common Mistakes Decoding Hex Escapes

  • Including the surrounding quotes from a code string literal in the input.
  • Mixing plain text in with the escapes instead of a pure \x sequence.
  • Assuming every byte sequence is valid UTF-8 — some escaped data is genuinely binary.

Why Use This Instead of Writing a One-Off Script

  • Handles multi-byte UTF-8 characters split across several escapes automatically
  • Runs entirely in your browser — nothing you type gets sent anywhere
  • Flags invalid UTF-8 instead of showing garbled output silently
  • Faster than opening a REPL just to decode one string

Limitations

  • Expects the \xHH format (as used in C, Python, and JavaScript string literals) — other escape styles like \u or %HH aren't recognized.
  • Decoded bytes are interpreted as UTF-8 text; a byte sequence that isn't valid UTF-8 returns an error.

Frequently Asked Questions

How do you decode \xHH escapes?

Find each \x followed by 2 hex digits, take that as one byte, then decode the full sequence of bytes as UTF-8 text.

What input format does this expect?

A continuous run of \xHH escapes with no other characters mixed in — copy just the escaped portion of a string literal, not the surrounding quotes or code.

Where do \xHH escapes show up?

Inside string literals in source code, in some log output that escapes non-printable bytes, and occasionally in URL or regex patterns that use this notation for raw byte values.

What if the escapes don't decode to valid text?

The calculator flags it — not every byte sequence forms valid UTF-8, so genuinely binary escaped data won't produce readable output.

Does this handle multi-byte characters split across several escapes?

Yes — a UTF-8 character spanning 2-4 bytes will show as that many consecutive \xHH escapes, and this decoder reassembles them into the single character they represent.

Is this the reverse of the Hex Escape Converter?

Yes — that page encodes text into \xHH escapes; this page decodes them back.

Is this the same as a general "hex code decoder"?

Yes — this decodes the specific \xHH escape notation, which is the most common form people mean when they search "hex code decoder" or "hex decoder" for source code or log data.

I found \x escapes in a Python repr() output — will this decode them?

Yes — Python's repr() uses this exact \xHH notation for non-printable bytes, so pasting that portion directly in decodes it the same way.