String Escape & Unescape
Escape and unescape strings for JSON, JavaScript, HTML, URL, and CSV. Handle special characters safely.
Result will appear here
How to Use
Enter Text
Paste or type the string you need to escape or unescape.
Select Format
Choose the escape format: JavaScript, JSON, HTML, URL, XML, CSV, Regex, or SQL.
Transform
Click Escape to encode special characters or Unescape to decode them.
Supported Formats
JavaScript
Escapes quotes, backslashes, and control characters (\n, \t, \r) for use in JavaScript strings.
JSON
Escapes strings according to JSON specification, including Unicode characters.
HTML
Converts &, <, >, ", and ' to HTML entities for safe display in web pages.
URL
Percent-encodes special characters for safe use in URLs and query strings.
XML
Escapes characters that have special meaning in XML documents.
CSV
Wraps strings in quotes and escapes embedded quotes for CSV files.
Regex
Escapes regex metacharacters (. * + ? ^ $ etc.) for literal matching.
SQL
Escapes strings for SQL. Supports multiple dialects: Standard SQL (doubles quotes), MySQL (backslash escaping), and PostgreSQL (same as standard).
FAQ
Why do I need to escape strings?
Escaping prevents special characters from being interpreted as code. This is essential for security (preventing injection attacks) and ensuring strings are processed correctly.
Is my text secure?
Yes. All processing happens in your browser. Your text never leaves your device.