Escape and unescape special characters for JavaScript, JSON, HTML, XML, URL, RegEx, SQL, CSV, Shell, Python, Java, and C#. Free, instant, browser-based.
What is String Escape / Unescape?
String Escape / Unescape is a free online tool that escapes and unescapes special characters in strings for 12 different contexts: JavaScript, JSON, HTML, XML, URL, Regular Expression, SQL, CSV, Shell/Bash, Python, Java, and C#. Escaping converts characters that have special meaning in a given context into their safe, encoded equivalents — and unescaping reverses the process. All processing runs entirely in your browser with no data transmitted to any server.
When to use it?
Use String Escape when you need to safely embed user-provided text in code, queries, or markup: preparing strings for JSON payloads, escaping HTML to prevent XSS vulnerabilities, encoding URL parameters, escaping special regex characters to match literal text, sanitizing SQL string values, properly quoting shell arguments, or preparing CSV fields with embedded commas and quotes. Use Unescape to decode and inspect already-escaped strings — for example, reading URL-encoded query parameters, decoding HTML entities, or converting escaped JSON strings back to readable text.
Common use cases
Frontend developers use String Escape to prepare user input for safe insertion into HTML and JavaScript. Backend developers use it to properly escape SQL values and shell command arguments. API developers use it to encode and decode URL parameters and JSON string values. DevOps engineers use it to escape special characters in shell scripts and configuration files. QA engineers use it to prepare test data containing special characters. Security researchers use it to test and verify proper escaping in applications.