String Escaper / Unescaper
Escape and unescape strings for JSON, SQL, HTML/XML, JavaScript, Regex, and CSV
This free online string escaper / unescaper runs in your browser and is part of our Text Tools collection.
String Escaper / Unescaper
Safely escape and unescape strings for JSON, SQL queries, HTML/XML entities, JavaScript, Regular Expressions, CSV, and URLs.
Supported Escaping Types
- JSON: Escapes double quotes (
\"), backslashes (\\), and control characters (\n,\t). - SQL: Escapes single quotes to prevent syntax errors and injection (
''or\'). - HTML: Encodes characters like
&,<,>,", and'into HTML entities. - Regex: Safely escapes all special regex characters (
. * + ? ^ $ { } ( ) | [ ] \) so text can be used as a literal match.
How to Use the Online String Escaper / Unescaper
Choose your target format: JSON, SQL, HTML/XML Entities, JavaScript/TypeScript, Regular Expression, or CSV.
Choose "Escape" to add safe backslashes and entities, or "Unescape" to restore clean raw strings.
Enter the string containing quotes, backslashes, tabs, HTML tags, or special characters.
Click "Transform" to inspect the escaped output and copy it directly into your code, query, or payload.
Frequently Asked Questions
Common questions about using this free online string escaper / unescaper.
What does JSON escaping handle? ▾
How does SQL escaping protect queries? ▾
What special characters are escaped for Regular Expressions? ▾
What is the difference between HTML escaping and URL encoding? ▾
More Text Tools
Explore related tools in the same category to solve adjacent tasks faster.