Escaping quotes and a line break
A two-line string with quotes, Hello "World" / New line, escapes to Hello \"World\"\nNew line on one line.
Escape and unescape strings for JavaScript and JSON online — free and instant.
About
Escapes text so it's safe to drop into a JavaScript or JSON string literal, or reverses an already-escaped string back into plain text.
Developers use it to turn a multi-line log message or code snippet into a single-line string literal they can paste into source code, and anyone debugging a payload uses it to turn an escaped string back into readable text. It's one of many free data tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.
Examples
3 worked examples
A two-line string with quotes, Hello "World" / New line, escapes to Hello \"World\"\nNew line on one line.
Unescaping the literal text Line1\nLine2 turns the \n into a real line break, giving two separate lines.
A Windows-style path like C:\Users\Name escapes each backslash to \\, giving C:\\Users\\Name.
FAQ
Quick answers to common questions about the String Escape and Unescape.
It escapes text into a safe, single-line JavaScript/JSON string literal, or reverses an escaped string back into plain text.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. Escaping and unescaping both happen entirely on your own device using JSON.stringify and JSON.parse built into your browser — nothing you type is sent to a server.
Line breaks become \n, tabs become \t, double quotes become \" , backslashes become \\ , and other control characters get their standard escape sequence, matching JavaScript/JSON string literal rules.
You'll see a clear error message — this is usually caused by an unescaped quote or a lone backslash in the text.
No. This tool escapes characters for a JavaScript/JSON string literal (like \n and \"), which is different from URL percent-encoding (like %20). Use the URL Encoder for that instead.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
It's built for typical text and log snippets. There's no artificial length limit, though very large inputs may take a moment longer.
Did String Escape and Unescape work for you?