String Escape & Unescape

Escape and unescape strings for JSON, JavaScript, Java, C#, Python, SQL, CSV, shell and regular expressions, or convert non-ASCII characters to \uXXXX.

Runs 100% in your browser. Nothing you paste is uploaded.

Raw text

—

Escaped

—

About the String Escape / Unescape

Embedding text inside source code or data formats requires escaping quotes, backslashes and control characters. This tool produces correct string literals for many languages — and unescapes them back, which is handy when you find a stringified JSON payload ("{\"id\":1}") in a log file.

Features

  • JSON, JavaScript, Java/C#/Kotlin, Python
  • Unicode \uXXXX for all non-ASCII
  • Regex metacharacter escaping
  • SQL single-quote doubling
  • CSV field quoting
  • Shell single-quote escaping

How to use it

  1. Pick Escape or Unescape and the target language.
  2. Paste the text.
  3. Optionally wrap the result in quotes and copy it.

Frequently asked questions

How do I un-stringify JSON from a log?

Choose Unescape + JSON string, paste the escaped value (with or without surrounding quotes), then format the result in the JSON Formatter.

Esc