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

  1. Paste Your String — Enter any JavaScript string, regex pattern, or HTML snippet.
  2. Choose Mode & Format — Select Escape or Unescape, then pick the target format (Unicode, Regex, HTML, or URL).
  3. Copy Result — The output updates live. Click Copy to grab the escaped or unescaped string.

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.

Related: Base64 Encoder/Decoder, URL Encoder/Decoder, HTML Entity Encoder.

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.

Related free tools

  • XML Formatter & Minifier — Beautify or minify any XML — SOAP, RSS, SVG, sitemap. Browser-based parser.
  • XML to JSON Converter — Parse any well-formed XML into a clean JSON tree with attributes and arrays.
  • JSON to XML Converter — Convert JSON to well-formed XML — supports attributes, custom root, declaration.
  • CSV Viewer — Open CSV or TSV files in your browser — sort, search, paginate, export filtered view.
  • JSON to CSV Converter — Convert JSON data to CSV format. Export to spreadsheets easily.
  • CSV to JSON Converter — Convert CSV data to JSON format. Useful for API development.
  • JSON Formatter — Format, beautify, or minify JSON with customizable indentation.
  • JSON Validator — Validate JSON syntax and find errors with line and column numbers.
  • HTML Minifier — Compress HTML by removing comments, whitespace, and line breaks.
  • CSS Minifier — Minify CSS by stripping comments, whitespace, and unnecessary characters.
  • JavaScript Minifier — Compress JavaScript by removing comments, whitespace, and empty lines.
  • Base64 Encoder/Decoder — Encode text to Base64 or decode Base64 back to text. UTF-8 support.

Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools