String Escape / Unescape
Escape or unescape strings for different contexts: JavaScript (\n, \t, \", \\), JSON (same as JS plus Unicode escapes), HTML entities (&, <, >, ", '), URL percent-encoding (%20, %3A, etc.), SQL string literals (single quotes doubled), and CSV (quote wrapping and double-quote escaping). Pick your target format and the conversion applies instantly.
Ctrl+Enter to run · Ctrl+K to switch tools · Recent button shows input history
Let AI do the hard part. Fix broken HTML, convert to email-safe HTML, or clean up any markup in one click — 3 free AI runs per day, no account needed.
Try the AI HTML FixerFAQ
What is the difference between JS and JSON escaping?
Both escape the same special characters, but JSON additionally requires Unicode escapes for characters above U+FFFF and does not allow single-quoted strings.
Is URL encoding the same as HTML encoding?
No — URL encoding converts characters to %XX hex sequences, while HTML encoding converts characters to named or numeric entities. Use URL encoding in query strings; HTML encoding in HTML attribute values and text content.
Does SQL escaping prevent injection?
Basic SQL string escaping (doubling single quotes) is a fallback — always use parameterized queries in production. This tool is for understanding the escape form, not as a security guarantee.