String Literal Escape / Unescape
Escape or decode JSON, JavaScript and SQL literals, raw UTF-8 hex bytes and Unicode escapes locally, without executing code.
Enabling local controls…
Result
Choose settings and run to produce a result. Unedited input is kept when an error occurs.
How to use this tool
Escape plain text into one complete quoted literal, or unescape a quoted literal. Choose the receiving language explicitly and compare the result before copying.
When not to use it
SQL mode uses standard doubled quotes, not dialect backslash escapes. JavaScript template interpolation is escaped; unescaped interpolation, octal and line continuations are rejected. Hex decodes UTF-8 strictly and preserves a leading BOM; Unicode mode requires complete raw escapes and paired surrogates. Escaping is not an SQL parameterization or XSS defense.