String Escape & Unescape
String Escape & Unescape escapes quotes, newlines and backslashes so text can sit inside a string literal in JSON, JavaScript, Python, C#, SQL or a POSIX shell, and unescapes escape sequences back into characters. It runs in your browser.
How to use String Escape & Unescape
- Paste your text.
- Choose the language and whether to escape or unescape.
- Copy the result.
Frequently asked questions
How do I escape a string for JSON?
Paste the text, choose JSON and copy the escaped result, ready to put between double quotes.
Which languages are supported?
JSON, JavaScript, Python, C#, SQL and POSIX shell.
Is escaping enough to prevent SQL injection?
No. Use parameterized queries. Escaping is for building literals by hand, not a security measure.
Next step
Need Unicode escape sequences specifically? Convert them. Open Unicode Escape & Unescape.