String Escape & Unescape
Escape text for JSON, JavaScript, shell, SQL, regex, or CSV — and turn escaped strings back into plain text.
Your Data Never Leaves Your Device
Every tool runs entirely in your browser. Nothing you type is uploaded, stored, or logged on our servers.
String Escape & Unescape converts text between its raw form and the escaped form a particular context requires. Each target has genuinely different rules: JSON escapes quotes and control characters with backslashes, SQL doubles apostrophes, POSIX shells need the close-escape-reopen dance around an apostrophe, regex needs every metacharacter neutralised, and CSV doubles quotes and only wraps a field when it contains a comma, quote, or newline.
Both directions are supported, and the Reverse button feeds the result back through the opposite way so you can confirm a value round-trips cleanly. Unescaping resolves uXXXX sequences including surrogate pairs, so emoji survive the trip intact. One caveat worth stating plainly: SQL escaping here is for building and debugging literals by hand — it is not a substitute for parameterised queries in application code.
FAQ
Those target one context each. This handles the escaping rules of programming and data contexts — JSON strings, JavaScript literals, shell arguments, SQL literals, regex patterns, and CSV fields — which all use different rules.
Pick Shell. It uses POSIX single-quoting, where everything is literal except the apostrophe itself, which is closed, escaped, and reopened. That is the only form that is safe for arbitrary content.
No. Doubling apostrophes is correct for building a literal, but it is not a substitute for parameterised queries. Use this for debugging and for hand-written one-off queries, not as an input-sanitising layer in application code.
It escapes every character with special meaning in a pattern, so the result matches your text literally. Escaping "a.b" gives a pattern that matches the exact string a.b rather than a, any character, b.
When it contains a comma, a double quote, or a line break. The tool adds quotes only when required and doubles any inner quotes, matching the RFC 4180 convention.
Yes. JSON and JavaScript unescaping resolves \uXXXX sequences, including surrogate pairs, so emoji and other astral-plane characters round-trip correctly.