String Unescaper

Text to Unescape
Options
Unescaped Result
Copied!

Escaped text is everywhere: JSON in log files, entities in RSS feeds, percent codes in URLs, quoted strings in shell history. It is correct for machines, but hard for people to read. The String Unescaper above turns escaped text back into plain text for 12 formats. It suggests the format when it can tell, lists invalid escapes instead of hiding them, and has an Unescape Again button for text that was escaped twice. It runs in your browser, so your text is never uploaded.

Table of Contents

What Is Unescaping?

Unescaping is the reverse of escaping. It turns \n back into a line break, & back into an ampersand, and %20 back into a space. Which rules apply depends on the format, so the same text can mean different things in different formats. For example, \u00e9 is the letter é in JSON, but it is just six characters in plain HTML.

How to Use the String Unescaper

  1. Paste the escaped text. Type or paste it into the box, or click Try Sample to see an example for the chosen format.
  2. Choose the format. If the text looks like another format, a hint appears with a button to switch.
  3. Set the options. You can choose whether to remove surrounding quotes, whether + means a space (URLs), and which SQL style to use.
  4. Read the result and the notes. Any escape that could not be read is listed with its line and column.
  5. Copy or download. Click Copy Result or Download .txt.

Examples

FormatEscaped textResult
JSON string "He said \"hi\"\n\u00e9 \ud83d\ude00" He said "hi" é 😀
URL name%3DJos%C3%A9%20%26%20Co%2F2026 name=José & Co/2026
HTML &lt;p class=&quot;x&quot;&gt;Tom &amp; Jerry &copy; 2026&lt;/p&gt; <p class="x">Tom & Jerry © 2026</p>
Shell 'It'\''s here' It's here
SQL 'O''Brien' O'Brien
Unicode caf\u00e9 \u{1F600} café 😀
Markdown \*not bold\* \[link\] *not bold* [link]
Regex a\.b\*c\(d\) a.b*c(d)

What Each Format Reads

  • JSON: \" \\ \/ \b \f \n \r \t and \uXXXX. Surrogate pairs such as \ud83d\ude00 become one emoji.
  • JavaScript: the JSON escapes plus \xHH, \u{...}, \0, \v, old-style octal escapes and line continuations.
  • Python: \xHH, \uXXXX, \UXXXXXXXX, octal escapes, \a, \v and line continuations. Named escapes such as \N{...} are not supported.
  • HTML: named entities such as &copy; and numeric ones such as &#233; and &#xE9;.
  • XML: the five predefined entities and numeric ones. Other named entities are reported, because XML does not define them.
  • URL: percent codes, including multi-byte UTF-8 characters.
  • Regex, Markdown: backslashes before special characters are removed.
  • SQL, CSV: doubled quotes become single quotes, and MySQL backslash escapes are read in MySQL mode.
  • Shell: single quotes, double quotes, backslashes and $'...' strings, also when they are mixed in one word.
  • Unicode escapes: \uXXXX, \u{...}, \UXXXXXXXX, \xHH and U+XXXX.

Text That Was Escaped Twice

A common problem is double escaping. You see \\n instead of \n, &amp;amp; instead of &amp;, or %2520 instead of %20. This happens when a value is escaped once by one system and again by the next one. After you unescape once, the result still contains escapes. Click Unescape Again to run the result through the same format again, and repeat until the text looks right.

Important! Unescaping text from an unknown source can produce HTML, script tags or shell commands. This tool only shows the result as plain text. If you use unescaped text in a web page, a database query or a command line, escape it again for that exact place first.

Limitations to Know

  • The format matters. A wrong choice gives a wrong result without an error. Use the suggestion hint and check the result.
  • Invalid escapes stay as they are. The tool never drops text it cannot read. It keeps it and tells you where it is.
  • Shell variables are not expanded. $HOME stays $HOME, and commands inside $(...) are never run.
  • Automatic quote removal. If your text has a real quote at the start and end that is not a wrapper, turn off Remove surrounding quotes.
  • Browser-based entities. HTML entities are decoded with your browser, which knows the complete list.

Frequently Asked Questions

Is the String Unescaper free, and is my text uploaded?

It is free and needs no signup. The text is unescaped in your browser and is never sent to a server.

How do I know which format to choose?

Look at the clues. Percent codes like %20 mean URL, entities like &amp; mean HTML, and backslashes like \\n or \\u00e9 usually mean JSON or JavaScript. The tool also shows a hint when it recognizes another format.

Why does my result still contain backslashes?

The text was probably escaped twice. Click Unescape Again. The tool also keeps invalid escapes as they are and lists them in the notes.

Why does + stay a plus sign in a URL?

In a URL path, a plus sign really is a plus sign. Only forms and query strings use + for a space. Turn on the plus option for that case.

Can I unescape many strings at once?

Yes. Put one string per line and choose Each line separately. Every line is processed on its own.

Does the tool run shell commands or expand variables?

No. It only reads the quoting and escape rules, and it never runs anything. Variables such as $HOME are kept as text.

Final Thoughts

Reading escaped text is easy once you know the format. Choose it, read the result, check any notes about invalid escapes, and use Unescape Again for text that was escaped twice. Keep the original escaped text, and remember that decoded text is plain text, not safe code.

Post a Comment