Backslash Escape / Unescape

Escape quotes, newlines, tabs and control characters with backslashes, or unescape \n, \t, \uXXXX sequences back to text. Free online string escaper.

About this tool

Escape or unescape strings for code. Quotes, backslashes, newlines, tabs and control characters are turned into \" \\ \n \t style escapes, and back.

How to use

  1. Select Escape or Unescape.
  2. Paste the string.
  3. Copy the result into your source code, JSON or log query.

Frequently asked questions

Which escapes are supported when unescaping?

\n \r \t \b \f \v \0, escaped quotes and backslashes, \xHH, \uHHHH and \u{…} code points.

What happens to unknown escapes like \q?

The backslash is removed and the character is kept, which matches how JavaScript treats them.

Are single quotes escaped?

No. Only double quotes are escaped, which suits JSON and most double-quoted string literals.

Related tools