JavaScript Escape
Escape text for use inside a JS/JSON string literal, live as you type, in either direction.
100% private, runs in your browser
Escapes text the way it would appear inside a JS/JSON string literal (quotes, backslashes, newlines) — type in either field, both directions update live. Runs entirely in your browser.
What is JavaScript Escape?
Type text and see it escaped the way it would need to appear inside a JavaScript or JSON string literal (quotes, backslashes, and newlines escaped) — type in either field, both directions update live.
FAQ
Yes, under the hood — it produces the exact escaping JSON.stringify would, minus the surrounding quotes, so you can drop the result straight into your own string literal.