Invisible characters breaking your JSON

When JSON looks perfectly correct but will not parse, the cause is usually a character you cannot see: a byte order mark, a non-breaking space or a zero-width character.

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
{
  "name": "My Mosaic"
}
Valid
{
  "name": "My Mosaic"
}

How this tool reports it

The formatter names these specifically rather than reporting an unhelpful unexpected character, tells you it looks like a space but is not, and offers to replace it. A byte order mark is skipped silently, because it is never what the author meant to include.

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