JavaScript Escape / Unescape
Escape text for JavaScript string literals or decode escape sequences back to text.
Runs locally in your browser. Your input is not uploaded.
How to Use
- 1
Choose the direction
Escape (text β literal-safe) or Unescape (decode sequences).
- 2
Paste your text
Multi-line input is fine β newlines become \n on escape.
- 3
Copy the result
Paste the escaped string directly between quotes in your code.
Frequently Asked Questions
- It converts characters that would break a string literal β quotes, backslashes, newlines, tabs β into escape sequences like \" \\ \n \t, so any text can be safely pasted between quotes in source code.
Related Tools
CSS FormatterMinify or beautify CSS stylesheetsJS FormatterMinify or beautify JavaScript codeHTML FormatterBeautify or minify HTML markupHTML EscapeEscape special HTML characters to entitiesHTML StripperRemove all HTML tags to extract plain textHTML EntitiesSearchable reference for all HTML entity codesSQL FormatterBeautify and format SQL queriesXML FormatterFormat, validate, and minify XML documents instantly