Single quotes
- Input
- {'a': 1}
- Expected output
- linha 1, coluna 2: aspas simples (single-quote-string)
JSON requires double quotes, and repair swaps them.
json unexpected token error
Paste the text that failed into the formatter. It lists every error at once, with line, column and an explanation, and marks the line in the editor margin. If the text has an obvious fix, the repair button shows what would change.
JSON requires double quotes, and repair swaps them.
Column 8 is the comma itself.
Points to the end of the value 1, where the comma should be.
Common in objects copied from the JavaScript console.
The error points to where the bracket was opened, not the end of the text.
No automatic fix: the server response was not JSON.
The most common causes are a comma after the last item, single quotes, an unquoted key, a comment, and a missing comma between two values. JSON.parse reports only the first problem and, in some browsers, only a character position. This formatter lists every error in the text, each with line and column, shows the snippet with an arrow under the exact spot, marks the line in the editor margin, and has a Go to the error button that selects the spot.
The text that reached JSON.parse starts with "<", which means it is HTML. Almost always the server answered with an error page, a 404 or a redirect to the login screen instead of the expected JSON. Check the status code and the raw response body in the browser network tab before touching the parser.
The text ended before the JSON was complete. It can be an empty string, a response cut off by a timeout or a half-saved file. In this formatter a truncated text shows up as unclosed brackets or quotes, pointing at where each was opened, and repair closes whatever was left open.
Not always. Missing commas and open brackets are only noticed after the real spot of the problem. That is why the formatter marks the position where the fix belongs, not just where the parser gave up.
Yes. Reading and analysis run locally, in a Web Worker, and nothing is sent to servers, which matters when the text carries tokens or customer data.