What it does
Paste text and get it escaped for the language you are writing, or paste an escaped literal and get the original text back. The output updates as you type.
| Format | Escaping rules |
|---|---|
| JSON string | \" \\ \n \t \uXXXX |
| C# string | \" \\ \0 \a \n \u, \U and \x escapes |
C# verbatim @"..." | quotes doubled: "" |
C# raw """...""" | picks a delimiter longer than any run of quotes in the text |
JavaScript '...', "...", `...` | \xHH, \u{...}, line continuations, \${ in templates |
| SQL | single quotes doubled: '' |
| CSV field | quoted only when needed, quotes doubled |
| XML / HTML | & < > " '; unescape decodes named and numeric entities |
| Regular expression | backslash before . * + ? ^ $ ( ) [ ] { } | / \ |
Notable features
- Unescape accepts the literal with or without its quotes, so you can paste
@"C:\temp"or'O''Brien'straight from code. - Precise errors: an invalid escape such as
\qin C# is reported with line and column. Warnings flag text that would break the literal, such as an unescaped quote. - Escape non-ASCII writes every non-ASCII character as an escape, useful for source files that must stay ASCII.
- Swap feeds the output back in and flips the direction to check a round trip.
Raw string literals take line breaks from the source file, so a lone carriage return cannot be represented exactly.
Privacy
Everything runs in your browser. Your input is kept in local storage only.