๐Ÿ”ง Escape/Unescape Tool

Escape or unescape text for HTML, URL, JSON and JavaScript strings โ€” instantly, in your browser.

Frequently Asked Questions

What does HTML escaping do?

HTML escaping converts characters like <, >, &, " and ' into their HTML entity equivalents (&lt;, &gt;, &amp;, &quot;, &#39;) so the text can be safely displayed inside HTML without being interpreted as markup.

What's the difference between URL encoding modes?

This tool uses encodeURIComponent/decodeURIComponent, which percent-encodes characters that aren't valid in a URL component (spaces become %20, & becomes %26, etc.) โ€” suitable for query string values.

How does JSON escaping work?

JSON escape wraps your text as a JSON string, converting special characters like quotes, backslashes and newlines into their \\" \\\\ \\n escape sequences. JSON unescape parses a JSON string literal back to plain text.

How is JavaScript escaping different from JSON?

JavaScript string escaping is similar to JSON but also escapes single quotes ('), which aren't part of the JSON spec โ€” useful when embedding text inside a JS string literal written with single quotes.

Is my text sent anywhere?

No. All escaping and unescaping happens instantly in your browser using JavaScript โ€” your text is never sent to a server.

Why does unescaping fail with an error?

JSON and JavaScript unescape expect the input to be a valid string literal (e.g. wrapped in matching quotes with correctly formed escape sequences). If the input isn't valid for the selected mode, the tool can't parse it and shows an error.

Why are some characters left unchanged after URL encoding?

encodeURIComponent leaves "unreserved" characters โ€” letters, digits, and - _ . ! ~ * ' ( ) โ€” untouched, since they're already safe in a URL component. Everything else is percent-encoded.

Can I switch modes without losing my input?

Yes โ€” switching between HTML, URL, JSON and JavaScript modes keeps your current input text in place. Only the escape/unescape logic changes; click Escape or Unescape again to re-run it in the new mode.

About Privacy My Account
Powered by AppCafe.in