Character Escape Tool — Escape & Unescape Special Characters Online

Escape or unescape special characters for HTML, JavaScript strings, URLs, and regular expressions — instantly.

Also test patterns with our Regex Tester or encode data with the Base64 Encoder.

🔒 Your text is processed locally — nothing is stored or uploaded.

Result
How to Use

How to Use the Character Escape Tool

1
Enter your text — paste any text containing special characters into the input box above.
2
Select the mode — choose HTML Escape, HTML Unescape, JavaScript String Escape, URL Encode, URL Decode, or RegEx Escape.
3
Click Escape / Unescape — the converted text appears instantly in the result box.
4
Copy the result — click Copy to grab the escaped text to your clipboard.
About

When to Escape Special Characters

Character escaping is required in different contexts to prevent characters from being misinterpreted. This character escape tool works as an HTML entity encoder, URL percent encoder, and RegEx escape utility for developers who need to sanitize text before using it in different runtime contexts.

HTML escaping is required whenever displaying user-provided text in a web page. Characters like <, >, and & are interpreted as HTML markup — if user input contains these characters and they are rendered unescaped, it can cause broken layouts or, in the worst case, cross-site scripting (XSS) vulnerabilities where injected scripts execute in other users' browsers. Escaping converts them to safe HTML entities: &lt;, &gt;, &amp;.

URL encoding is required when including user input in query string parameters or path segments. Spaces and special characters like &, =, and ? have special meanings in URLs — unencoded, they would break the URL structure. This tool uses encodeURIComponent, which encodes all characters except unreserved ones, making it safe for embedding values in query parameters.

JavaScript string escaping is needed when embedding text in string literals — newlines become \n, tabs become \t, and quote characters that match the string delimiter must be backslash-escaped to prevent premature string termination. This is common when generating JavaScript code dynamically or embedding data in inline script blocks. All processing runs in your browser — your text is never sent to any server.

RegEx escaping is needed when building a regular expression pattern from a user-provided string. Characters like ., *, and ( are regex metacharacters. Without escaping, they change the pattern meaning rather than matching the literal character — a search for "price (USD)" would break without escaping the parentheses. All six escape modes on this tool cover the most common developer contexts and run entirely in your browser.

FAQ

Frequently Asked Questions

Yes, completely free with no account or signup required. Open the page and start escaping immediately.
It supports HTML escape, HTML unescape, JavaScript string escape, URL encode (encodeURIComponent), URL decode, and RegEx escape.
No. All processing runs entirely in your browser — your text is never sent to any server or stored anywhere.
You need to escape HTML characters when displaying user-provided text in a web page, to prevent characters like < > & from being interpreted as HTML tags or entities. This prevents XSS vulnerabilities.
Related tools

Related Free Tools