Skip to content

JSON Escape / Unescape

Escape or unescape JSON string characters.

Loading…

About JSON Escape / Unescape

Pasting a multi-line message or a Windows path straight into a JSON string breaks the document, because quotes, backslashes and line breaks all need escapes. Drop the raw text in and the output is ready to sit between your own double quotes: a backslash is doubled, a newline becomes \n, a tab becomes \t and other control codes become \u00XX sequences. Accented letters, emoji and the forward slash stay as they are. Unescape reverses it and tells you where an invalid escape sits.

Features

  • Escapes quotes, backslashes and control characters
  • Newlines and tabs become \n and \t, other control codes become \u00XX
  • No outer quotes added, so you place it inside your own
  • Unescape accepts text with or without surrounding quotes
  • Names the invalid escape and its position when unescaping fails

Limitations

  • Unescape rejects escapes that JSON does not define, such as \q, \' or a \u not followed by four hex digits.
  • Forward slashes and non-ASCII characters are left as they are, and there is no option to write them as \/ or \uXXXX.

How it works

  1. Paste the raw text, or the escaped string, into the JSON Input panel.
  2. Choose Escape or Unescape with the toggle in the middle column.
  3. Read the JSON Output panel, which updates as you type, and look for an error box if Unescape fails.
  4. Select Copy Output and paste it between double quotes in your JSON, or Clear All to start over.

Example input

Line one
Line two with a "quote" and a \ backslash

Frequently asked questions