Unescaped characters in a JSON string

A literal newline, tab or quote inside a JSON string is a parse error. Here is what has to be escaped and how to fix a document that is not.

Open the JSON formatter

What the error looks like

Different engines word this differently. You may see any of these:

Why it happens

Example

Invalid
{
  "note": "line one
line two",
  "path": "C:\Users\me"
}
Valid
{
  "note": "line one\nline two",
  "path": "C:\\Users\\me"
}

How this tool reports it

The formatter reports the offending string and offers to re-escape it, preserving the text you meant rather than deleting the characters it could not read.

Paste your JSON into the formatter to see the exact line and column, or use the validator if you only need to check it.

Worth knowing