Escaping runs entirely in your browser — nothing is uploaded.
Embedding arbitrary text in JavaScript source means escaping the characters that would otherwise terminate the string or start an interpolation. Unlike JSON, JavaScript has three string forms — single quotes, double quotes and backtick template literals — each with its own quote to escape. This tool escapes for all of them, and reverses the process, entirely in your browser.
| Character | Escaped as |
|---|---|
Backslash \ | \\ (escaped first) |
Quotes ' " ` | \' \" \` |
| Newline / return / tab | \n / \r / \t |
In backtick strings the sequence $${} begins interpolation. If your text contains a literal $ followed by {, escape the backtick form or switch to a quoted string — otherwise the runtime tries to evaluate the contents as an expression.