We use essential storage to make the site work. If you accept, we also use Google Analytics to understand usage and Google AdSense to show ads, which may set cookies. You can change your choice any time with Cookie settings in the footer. Privacy Policy
JavaScript Escape / Unescape
Free JavaScript escape and unescape tool. Convert strings to Unicode, regex-safe, HTML entity, or URL-encoded formats. 100% private, runs locally.
How to use
Paste Your String — Enter any JavaScript string, regex pattern, or HTML snippet.
Choose Mode & Format — Select Escape or Unescape, then pick the target format (Unicode, Regex, HTML, or URL).
Copy Result — The output updates live. Click Copy to grab the escaped or unescaped string.
Frequently asked questions
What is Unicode escaping?
Unicode escaping converts non-ASCII characters into \uXXXX or \xXX sequences so they can be safely embedded in JavaScript source code, JSON, or URLs.
Does regex escaping handle all special characters?
Yes. It escapes all regex metacharacters: . * + ? ^ $ { } ( ) | [ ] \ so they are treated as literal characters.
Can I escape HTML entities?
Yes. The HTML mode converts &, <, >, ", and ' into their corresponding HTML entities for safe rendering in web pages.
Is this safe for passwords?
All processing happens locally in your browser. Your strings are never transmitted to a server.
Free JavaScript Escape / Unescape Tool
Escape and unescape JavaScript strings for Unicode, regex, HTML, and URL contexts. Instantly convert special characters into safe, portable sequences and back again.
Common Uses
Embed special characters in JavaScript source files
Escape user input before building regex patterns dynamically
Sanitize text for safe HTML rendering
Encode text for URL query parameters
Decode escaped strings from APIs or logs
Supported Formats
Unicode — \uXXXX and \xXX escapes for JS strings
Regex — Escapes all regex metacharacters
HTML — <, >, ", &, '
URL — encodeURIComponent / decodeURIComponent
Privacy
Everything is processed locally. No strings are sent to any server.