JSON String Escape & Unescape

Stop quotes and line breaks from breaking your JSON. Everything runs in your browser; nothing you enter is uploaded or stored.

  • Free, no sign-up
  • Runs in your browser
  • Verified

How to use it

  1. Choose escape or unescape.
  2. Paste your text.
  3. Copy the result.

How it works

Escaping uses JSON string rules: quotes become \", backslashes \\, line breaks \n, tabs \t and other control characters \uXXXX. Unescaping parses the text as a JSON string (with or without the surrounding quotes) and reports a clear error if it is not valid.

Examples

  • He said "hi" followed by a line break becomes "He said \"hi\"\n".

Limitations

  • JSON string rules only. Other languages (for example Python, SQL, shell) have different escaping rules.

Last verified . See our Accuracy & Editorial Policy. Found a problem? Email [email protected].