Backslash Escape & Unescape
Add or remove backslash escaping for strings — newlines, tabs, quotes and Unicode — in your browser.
About Backslash Escape & Unescape
Escape turns raw text into a safe string literal: newlines become \n, tabs become \t, and backslashes, quotes and other control characters are escaped so you can paste the result straight into source code. Unescape does the reverse, interpreting \n, \t, \r, \xHH, \uHHHH and \u{...} sequences back into the characters they represent.
Quote escaping is optional, so you can escape only whitespace and control characters when you don't need quotes touched. Everything runs locally in your browser; your text is never uploaded.
Escape a string
Line one Line "two"
Line one\nLine \"two\"
Unescape converts it back to the original two lines.
Frequently asked questions
Which escape sequences are supported?
Escaping produces \n, \r, \t, \b, \f, \v, \0, \\ and (optionally) escaped quotes, plus \xHH for other control characters. Unescaping also understands \uHHHH and \u{...} Unicode escapes.
Can I escape without touching quotes?
Yes. Turn off quote escaping to escape only newlines, tabs and control characters while leaving " and ' as-is.
What happens to an unknown escape when unescaping?
The backslash is dropped and the following character is kept literally, so \q becomes q.
Is my text uploaded anywhere?
No. Escaping and unescaping run entirely in your browser.