Escape and unescape strings for JSON payloads.
Escape and unescape strings for safe use in SQL queries.
Beautify and indent JavaScript and TypeScript code blocks.
Encode or decode Base64 strings instantly with size metrics.
Find and replace text using regular expressions and capture groups.
Wrap text at specified column width, add line prefixes/suffixes, and indent.
Pasting arbitrary text straight into a JavaScript string literal rarely survives contact with reality: a quote closes the string early, a backslash swallows the next character, and a line break makes the file stop parsing entirely. Escaping converts those characters into the sequences JavaScript expects — \" for a quote, \\ for a backslash, \n for a newline — so the literal holds exactly what you meant. This tool escapes in that direction and unescapes back again, which is just as useful when you are reading a minified bundle or a stack trace and want the original text. Typical uses are embedding a snippet in a test fixture, building a string constant from prose, or recovering readable text from escaped source. Everything runs client-side in your browser, so nothing you paste is uploaded, and the conversion round-trips exactly.
The quote character that delimits the string, the backslash itself, and control characters such as newline, carriage return, and tab. Everything else can normally appear literally.
Yes. Unescape mode converts the sequences back, so \n becomes a real newline and \\ becomes a single backslash, recovering the original text exactly.
Mostly, but the delimiter differs. Template literals are delimited by backticks and can span lines, so backticks and ${ need escaping there while newlines do not.
Not automatically. A sequence such as </script> inside your text will still terminate an inline script block even within a string. When embedding in HTML, also escape the forward slash as <\/script>.
No. Accented letters and non-Latin scripts are left as-is, which keeps the output readable. Modern JavaScript sources are UTF-8, so this is safe.
No. The escaping runs entirely in your browser and the text is never transmitted, stored, or logged.