Escape / Unescape

Process JSON, JavaScript, HTML, and URLs

Loading tool…

About String Escape & Unescape Tool

String Escape & Unescape Tool transforms text for JSON, JavaScript, HTML, and URL contexts, making control characters and delimiters visible.

Escaping is not one universal operation. The correct result depends on where the value will be inserted and how the receiving parser interprets quotes, backslashes, angle brackets, line breaks, and percent signs.

How to use this developer tool

  1. Choose the source and target context.
  2. Paste a small representative value and run escape or unescape.
  3. Inspect delimiters and control characters, then validate the result with the parser that will consume it.

Privacy and data handling

Conversions happen locally in the browser. Use redacted examples and remember that escaping does not sanitize untrusted input or make a value safe for a different context.

Related developer tools

Frequently asked questions

Is escaping the same as sanitizing?

No. Escaping represents characters for one context; sanitization removes or restricts unsafe content according to the target parser and policy.

Why did the output gain backslashes?

JSON and JavaScript string literals use backslashes to represent quotes, line breaks, and other control characters inside a string.

Can I use HTML escaping inside a URL?

No. Use the encoding rules of the target context. HTML entities and URL percent-encoding solve different problems.