JJSONForge
Get JSONForge

JsonForge · JSON errors

NaN and Infinity are not valid JSON

JSON has no NaN, Infinity or -Infinity. JSON.stringify turns them into null; anything that writes them literally produces a document nothing can read.

The smallest input that causes it

{"a": NaN}

JSON.parse on that gives, verbatim:

Unexpected token 'N', "{"a": NaN}" is not valid JSON

The fix

{"a": null}

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