JJSONForge
Get JSONForge

JsonForge · JSON errors

Unexpected token at position 0

Something invisible sits before the first brace — most often a UTF-8 byte order mark written by Excel, Notepad or a Windows export.

Position 0 with a document that looks correct is the signature of a BOM. Strip it: raw.replace(/^\uFEFF/, "").

The smallest input that causes it

{"a": 1}

JSON.parse on that gives, verbatim:

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

The fix

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