String Escape / Unescape

Escape text for source code (newlines, tabs, quotes, backslashes, \uXXXX) and unescape it back — instantly, in your browser.

Escaped

🔒 Escaped in your browser — nothing is uploaded. Handles newlines, tabs, quotes and backslashes; \uXXXX is always read back, and written too when you tick the box.

Escape text for code, and back

Paste text to see it escaped for embedding in a string literal — newlines become \n, tabs \t, quotes \" and backslashes \\. Paste escaped text in the second box to turn it back into plain text. \uXXXX escapes are always decoded, and now one checkbox writes them too: tick Escape non-ASCII as \uXXXX and every character above ASCII leaves as \uXXXX — an emoji as the two escapes a string literal actually holds — for a literal that is pure ASCII. Everything runs in your browser.

When you need it

Handy when you have to drop a multi-line snippet, a path, or text with quotes into a JSON value, a JavaScript string, or a config file without breaking the syntax.

Frequently asked questions

Which escapes are supported?

Escaping handles newlines, carriage returns, tabs, double quotes and backslashes, and — with the "Escape non-ASCII as \uXXXX" box ticked — every character above ASCII as \uXXXX, a surrogate pair as its two escapes. Unescaping understands all of those plus \b, \f and \/.

Is this the same as JSON.stringify?

It covers the same common escapes for embedding text in a string, without adding the surrounding quotes, so you can paste the result straight into an existing string.

Is my text uploaded?

No. Escaping and unescaping run entirely in your browser.