String Escape / Unescape

Escape and unescape strings for JSON, HTML, URL, JavaScript, and SQL. Handles special characters, quotes, and Unicode sequences.

Input
Output

String Escape & Unescape Tool — Handle Special Characters

When working with strings in programming, special characters like quotes, backslashes, angle brackets, and ampersands must be escaped to avoid syntax errors, injection attacks, or broken output. This free online string escape tool handles all common escaping formats.

Supported Escape Formats

  • JSON Escape — escapes backslashes, quotes, newlines, tabs, and control characters for use in JSON strings. e.g., "\"
  • HTML Escape — converts <, >, &, ", ' to HTML entities. Essential for preventing XSS in web applications.
  • URL Encode/Decode — encodes special characters using percent-encoding for use in URLs and query strings. e.g., space → %20
  • JavaScript Escape — escapes strings for safe embedding in JavaScript code, handling single/double quotes and newlines.
  • SQL Escape — escapes single quotes and special characters to help prevent SQL injection. e.g., '''

Why String Escaping Matters

Improper string handling is one of the most common causes of security vulnerabilities including XSS (Cross-Site Scripting) and SQL Injection. Always escape user input before embedding it in HTML, SQL queries, or JavaScript.

Translate Page