Search for a command to run...
Escape and unescape strings for JSON, JavaScript, Java, SQL, CSV, shell, regex, and XML in one place.
Escapes the double quote and backslash, uses \b \f \n \r \t, and falls back to \u00XX for any other control character.
Wrap in quotes
Show the result with its surrounding quotes so it is ready to paste. When unescaping, matching outer quotes are removed first.
Escape non-ASCII
Rewrite every character above U+007E as \uXXXX so the output stays pure ASCII.
The result updates automatically as you type.
What
String escaping rewrites the characters that would otherwise terminate or corrupt a string literal in a given language or file format. This tool converts text in both directions for JSON, JavaScript, Java or C#, SQL, CSV, POSIX shell, regular expressions, and XML attributes.
Cases
Embed a multi-line log excerpt in a JSON fixture.
Build a JavaScript literal without breaking the surrounding quotes.
Quote a file path that contains spaces for a POSIX shell command.
Prepare a CSV field that holds commas, quotes, or line breaks.
Turn arbitrary user input into a literal regular expression pattern.
Decode an escaped payload copied out of a stack trace or log line.
How To
Choose a direction, pick a target format, paste your text, and copy the result.
Switch between Escape and Unescape at the top of the options panel.
Select JSON, JavaScript, Java or C#, SQL, CSV, shell, regex, or XML.
Type or paste the value; the result is recalculated on every keystroke.
Enable quote wrapping for a ready-to-paste literal, then copy the output.
Knowledge
FAQ