Text & Regex
Multi-Context String Escaper
Escape or unescape a string for the context you are working in — HTML, JavaScript, JSON, SQL, URLs or regular expressions. Pick a context, see the safe result instantly, then copy or download it. Everything runs in your browser and your text never leaves the page.
Input
plain textType or paste text. The result updates as you type.
Output
HTML entitiesCopy, download, or share a link to reproduce this result.
How it works
Each context has its own well-defined escaping rule. HTML uses entities,
JavaScript and JSON produce a quoted string literal, SQL wraps the value in
single quotes and doubles embedded quotes, URLs use
encodeURIComponent, and regex backslash-escapes metacharacters.
Unescaping reverses each rule and reports a clear message when the input cannot
be decoded. Invalid input never leaves you with a broken state, and all
processing happens in this page — there are no network requests.