Toolhaus

String Escape / Unescape

Escape and unescape backslash sequences like \n, \t and \".

Output

The escaped result is a JSON/JS string body without surrounding quotes.

Formula & methodology

Escaping serializes the text as a JSON string and drops the surrounding quotes. Unescaping interprets \n, \t, \r, \", \\, \uXXXX and \xXX sequences back into characters.

Worked example

  • Line 1 Line 2 "end"Line 1\nLine 2\t\"end\"
  • caf\u00e9café

Frequently asked questions

What escapes are supported?

On unescape: \n, \t, \r, \b, \f, \v, \0, \", \', \\, \/, plus \uXXXX and \xXX. Escaping produces the standard JSON set.

Is the output wrapped in quotes?

No. The escaped result is the string body without the surrounding quotes, so you can paste it wherever you need.

Privacy

All processing happens locally in your browser. Your data is never uploaded.

Related tools