DevNb

Text & Strings/String Escape & Unescape

String Escape & Unescape

Encode and decode special characters for HTML, JavaScript, JSON, Regular Expressions, URLs, SQL, and CSV.

Target:HTML markup containing tags, quotes, ampersands, and apostrophes
Input (Raw String)1 line88 chars
Output (Escaped Result)1 line144 chars

Supported Escape Formats

HTML Entities: Converts <, >, &, and quotes to entity codes (&lt;) 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 &amp;) and numeric entities (like &#39; or hex &#x27;) 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 →