Text & Strings/String Escape & Unescape
String Escape & Unescape
Encode and decode special characters for HTML, JavaScript, JSON, Regular Expressions, URLs, SQL, and CSV.
Supported Escape Formats
HTML Entities: Converts <, >, &, and quotes to entity codes (<) to prevent XSS and rendering glitches.
JavaScript / JSON: Escapes newlines (\n), tabs (\t), quotes, and backslashes for safe string literals.
Regex: Escapes metacharacters like .*+?^$()|[]\ with backslashes so they can be treated as literal characters.
URL / URI: Percent-encodes spaces and query parameters (%20, %26) for valid HTTP requests.
SQL: Escapes single quotes by doubling them (O''Reilly) and escaping backslashes.
CSV: Formats strings with RFC 4180 rules, quoting fields containing commas, quotes, or newlines.
FAQ
Does unescape handle numeric HTML entities?
Yes. Both named entities (like &) and numeric entities (like ' or hex ') are correctly decoded.
Can I swap input and output?
Yes. Click the ⇄ Swap button to transfer the output into the input pane and toggle between escaping and unescaping instantly.
Need to compare escaped vs raw output? Try the Text Diff Checker →