JJSONForge
Get JSONForge

JsonForge · JSON errors

"undefined" is not valid JSON

The string "undefined" was passed to JSON.parse — typically from localStorage.getItem() on a missing key, or from JSON.stringify(undefined) which returns undefined rather than a string.

JSON has null but no undefined. Guard the read: JSON.parse(raw ?? "null").

The smallest input that causes it

undefined

JSON.parse on that gives, verbatim:

"undefined" is not valid JSON

The fix

{"value": 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