JavaScript Escape Unescape Tool for JavaScript Strings
JavaScript Escape Unescape converts JavaScript string content between readable text and escaped forms. Escape mode handles backslashes, quotes, common control characters, and non-ASCII characters as \uXXXX or \u{…}; template-literal mode also escapes backticks and ${. Unescape mode recognizes \uXXXX, including surrogate pairs, \u{…}, \xXX, and named escapes. Paste or drop text, select the direction, and copy the result.
JavaScript Escape Unescape is a browser-based tool for converting JavaScript string content between readable text and escaped forms. Use it to prepare text for source code, inspect sequences in an escaped string, or convert content back and forth without editing each character by hand.
In Escape mode, the tool escapes backslashes, single and double quotes, and common control characters, including newline, carriage return, tab, backspace, form feed, vertical tab, and null. Non-ASCII characters are represented as \uXXXX or the modern \u{…} form. Template-literal mode also escapes backticks and ${. In Unescape mode, the tool handles \uXXXX sequences, including surrogate pairs, \u{…}, \xXX, and named escapes.
JavaScript strings can contain escape sequences to represent characters and protect string syntax. Converting readable text to escaped text can help when preparing a string for code, while unescaping can make encoded content easier to read. The tool supports both directions, so you can choose the representation that fits your task.
The conversion runs entirely in your browser. Your input is processed on your device and nothing is uploaded, stored, or sent to a server; after the page has loaded, the tool also works offline. This gives you a private way to work with string content without relying on a server connection.
JavaScript Escape Unescape can help developers and DevOps engineers prepare source-code strings, inspect escaped values, and work with template-literal content. Paste or drop text, choose Escape or Unescape, and copy the result for your next step.
Step 1: Paste or drop your JavaScript text into the tool. You can start with readable text that needs escaping or an escaped string that you want to inspect.
Step 2: Choose Escape to encode the text or Unescape to turn escape sequences back into characters. Select the direction that matches the form of your input.
Step 3: When escaping text for a template literal, use template-literal mode. It also escapes backticks and ${ so they are represented safely in that context.
Step 4: Review the converted text and copy the result. Check that the output is the form you need before adding it to your JavaScript code.
Use case: Embed a JavaScript string inside another JavaScript string without breaking its quoting. Escaping quotes and backslashes helps keep the string representation intact.
Use case: Read a densely escaped string by converting its escape sequences back into characters. This makes the text easier to inspect.
Use case: Prepare a literal for pasting into source code. Escape the characters that could otherwise affect the string syntax.
Use case: Convert text for use in a template literal. Template-literal mode also escapes backticks and ${.
Use case: Inspect Unicode escapes in JavaScript text. Unescaping supports \uXXXX, surrogate pairs, and \u{…} forms.
Use case: Check how common control characters are represented in a string. Escape mode handles characters such as newlines, tabs, and carriage returns.