Home › Tools › JavaScript › JavaScript String Escape / Unescape

JavaScript String Escape / Unescape

Escape text for safe use in JavaScript strings, or unescape it. Free, private and instant.

About the JavaScript String Escape / Unescape

Quotes, backslashes and new lines must be escaped inside JavaScript strings. Escaping converts raw text into a safe string literal.

When to use it

Use it when embedding text in code or JSON, and unescape to read strings copied from logs or source files.

How to use the JavaScript String Escape / Unescape

  1. Enter or paste your input in the fields above.
  2. The result updates as you type, or press Run.
  3. Press Copy to copy the output.

Frequently asked questions

Is the JavaScript String Escape / Unescape free?

Yes. It is completely free, with no signup and no usage limits.

Is my data uploaded anywhere?

No. Everything runs locally in your browser, so what you type never leaves your device.

Does the JavaScript String Escape / Unescape work on mobile?

Yes. The tool is responsive and works on phones, tablets and desktops.

More free tools

{}JSON Formatter & Validator

Format, minify and validate JSON instantly.

JavaScript
{}Regex Tester

Test regular expressions and list every match with index.

JavaScript
{}JSON to CSV Converter

Convert a JSON array of objects into CSV with proper quoting.

JavaScript
{}JSON Key Sorter

Sort JSON object keys alphabetically, including nested objects.

JavaScript
{}JavaScript Date Formatter

Convert any date into ISO, UTC, local and Unix formats.

JavaScript
AaBase64 Encoder / Decoder

Encode or decode Base64 with full UTF-8 support.

Utilities
Copied!