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.

Runs in your browser v1.0.0

Context & direction

live
Target context
Direction

Escapes &, <, >, " and ' so text is safe inside HTML. Unescaping also understands decimal and hex numeric references such as &#38; and &#x26;.

Input

plain text

Type or paste text. The result updates as you type.

Output

HTML entities

Copy, 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.