String Escape / Unescape

Escape and unescape strings for JSON, XML, HTML, SQL, and URLs.

📝 Input
✨ Escaped Output

How to Use

  1. Select the format: JSON, XML, HTML, SQL, or URL
  2. Paste your string in the Input panel
  3. Click 🔒 Escape to encode special characters, or 🔓 Unescape to decode
  4. Use ⇆ Swap to move the output back to input for chained operations

When to Escape Strings

String escaping is essential for security and correctness. JSON requires escaping quotes and backslashes. XML needs entities for angle brackets and ampersands. HTML encoding prevents XSS attacks. SQL escaping helps prevent injection (though parameterized queries are always preferred). URL encoding ensures special characters are transmitted correctly in web requests.