String Escape & Unescape
Escape special characters in strings for JSON, JavaScript, Java, Python, or XML — and unescape them back.
Features
How to Use
1. Pick the language (JSON, JavaScript, Java, Python, XML).
2. Pick Escape or Unescape.
3. Paste your string and copy the result.
About this tool
Special characters such as quotes, backslashes and line breaks have to be written as escape sequences before they can sit inside a string literal in code or data. The rules differ between languages, which is where copy-pasted text causes syntax errors and broken configs. This tool escapes or unescapes text for five targets: JSON, JavaScript, Java, Python and XML. JSON escaping follows JSON.stringify, so quotes, backslashes and control characters become \", \\, \n and \u escapes; the JavaScript, Java and Python modes handle quotes, backslashes and common control characters for their string literals; XML converts &, <, >, " and ' into entities. Paste text, pick the language and direction, and copy the result into your code.