JJSONForge
Get JSONForge

JsonForge · JSON errors

Comments are not allowed in JSON

JSON has no comment syntax. Files that look like JSON but carry comments are JSON5 or JSONC — tsconfig.json is JSONC, which is why editors accept it and JSON.parse does not.

The smallest input that causes it

{
  // the id
  "id": 1
}

JSON.parse on that gives, verbatim:

Expected property name or '}' in JSON at position 4 (line 2 column 3)

The fix

{"id": 1}

That version parses.

Find it in your own document

Paste the JSON and get the error located by line and column, the document formatted, a schema inferred from it, and a diff against another version.

Open JsonForge

Other JSON errors