Report

Help us improve this tool

JavaScript Escape Unescape

Escape and unescape JavaScript strings instantly

O M T

JavaScript Escape and Unescape Tool

Use this tool to quickly convert plain JavaScript text into escaped JavaScript strings and decode escaped sequences back to readable text. It is useful when embedding JavaScript snippets inside strings, JSON payloads, templates, and logs. For Java escape/unescape operations, try the Java Escape Unescape tool.

What it supports

The converter handles common escape sequences such as quotes, backslashes, tabs, and line breaks using JavaScript-compatible behavior. Paste your input, switch mode, and copy the output instantly. For converting JSON data to a string format, use the JSON to String Converter.

Frequently Asked Questions

When should I use JavaScript escaping?

Use escaping when you need to place text safely inside JavaScript string literals or transport strings containing special characters.

Why does unescape show an error for some input?

Invalid or incomplete escape sequences can't be parsed as valid JavaScript strings. Correct the malformed sequence and try again. For encoding data for URLs, check out the JSON URL Encode tool.