JavaScript Escape Unescape Tool for JavaScript Strings
Convert JavaScript strings by escaping characters or turning supported escape sequences back into readable text. Escaping covers backslashes, quotes, common control characters, and non-ASCII characters as \uXXXX or \u{…}. Template-literal mode also escapes backticks and ${, while unescaping supports \uXXXX surrogate pairs, \u{…}, \xXX, and named escapes. A JSON-safe option is available.
JavaScript Escape Unescape is a browser-based tool for converting JavaScript strings between readable characters and escape sequences. Use it to escape text for a string literal or unescape supported sequences when you need to inspect the original characters. It handles backslashes, quotes, common control characters, and non-ASCII characters.
When escaping, non-ASCII characters can be represented as \uXXXX or the modern \u{…} form. Template-literal mode also escapes backticks and ${. The tool provides a JSON-safe option as well. When unescaping, it recognizes \uXXXX sequences, including surrogate pairs, along with \u{…}, \xXX, and named escapes.
JavaScript strings can contain characters directly or represent them with escape sequences. Converting between those forms can help when preparing text for source code or making escaped content easier to read. Escape and Unescape let you work in either direction, depending on whether you need to encode characters or restore them.
The conversion runs entirely in your browser, and your input is not sent to a server. The tool is free and works offline once the page has loaded, so you can use it without a network connection after that point. It can help developers and DevOps engineers who need to prepare, inspect, or troubleshoot JavaScript string content.
Step 1: Paste or drop your JavaScript text into the tool. Start with the string or content you want to convert.
Step 2: Choose Escape or Unescape. Escape converts characters to escape sequences, while Unescape turns supported sequences back into characters.
Step 3: Select an option if it fits your input. Template-literal mode also escapes backticks and ${, and a JSON-safe option is available.
Step 4: Copy the result for use in your code or workflow. Review it before inserting it into a larger string or file.
Use case: Embed a JavaScript string inside another JavaScript string without breaking the quoting. Escaping quotes and backslashes helps prepare the text for source code.
Use case: Read a densely escaped string by converting supported escape sequences back into characters. This can make text easier to inspect while debugging.
Use case: Prepare a string literal for pasting into JavaScript source code. Escape characters that would otherwise need to be represented with escape sequences.
Use case: Work with text intended for a template literal. Template-literal mode also escapes backticks and ${.
Use case: Inspect strings that contain Unicode or hexadecimal escape sequences. Unescaping supports \uXXXX, surrogate pairs, \u{…}, and \xXX.
Use case: Prepare JavaScript string content for JSON-related work using the available JSON-safe option.