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.
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: <, >, &.
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.