JSON does not support comments

JSON has no comment syntax. // and /* */ both cause a parse error. Here is why, what to do instead, and which JSON-like formats do allow them.

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
{
  // the display name
  "name": "My Mosaic",
  /* version */
  "version": 2
}
Valid
{
  "_comment": "name is the display name",
  "name": "My Mosaic",
  "version": 2
}

How this tool reports it

The formatter reports each comment and offers to strip them, leaving the rest of the document exactly as it was.

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