Browser tool · Local processing

JavaScript Escape / Unescape Converter

Escape or unescape JavaScript strings directly in your browser. Use the legacy escape() and unescape() formats or modern URI, Unicode, HTML and JSON encoding methods. Your input never leaves this page.

Legacy JavaScript · deprecated
URI encoding · modern
String & data formats
● Local processing — no data is sent

How to escape or unescape a JavaScript string

Paste a string into the input field, choose an operation and select Convert. Escape operations turn characters into a transport-safe representation; unescape operations restore that representation to readable text. Use Swap to move the result back into the input field for a reverse conversion.

For JavaScript source-code characters such as quotes, backslashes and line breaks, use JSON String Escape. For URL values, use encodeURIComponent(). The legacy modes are intended only for older data that already uses %XX or %uXXXX sequences.

Legacy compatibility and modern encoding are not the same

The global JavaScript functions escape() and unescape() are deprecated web-legacy features. They represent UTF-16 code units as %XX or %uXXXX. Modern URI functions use UTF-8 percent-encoding and should be preferred for new applications. See the comparison of escape(), encodeURI() and encodeURIComponent() for guidance.

Safety: This tool treats all input as plain text. Decoded JavaScript, HTML and URLs are never executed, rendered or requested.

About “Complete Escape”

The historical Web-Code.org converter was referenced by Google Campaign Manager documentation for a “Complete Escape” operation. This rebuilt mode percent-encodes every UTF-16 code unit so that legacy unescape() can restore the original text. It is provided for compatibility, not recommended for new code.

Escaping quotes and special characters

JavaScript string escaping is different from legacy URL-style escaping. If you need to represent quotation marks, backslashes or control characters inside source code, read the JavaScript escaping guide.