Fix Invalid JSON
Invalid JSON fails to parse, so tools cannot build a tree or run transforms until the syntax is fixed. This guide covers common parse errors and how Online JSON Viewer surfaces them so you can correct the document in place.
Common parse errors
-
Trailing commas — a comma after the last property
or array item (
{"a": 1,}) is invalid in JSON. -
Single quotes — strings must use double quotes
(
"ok"), not'ok'. -
Unquoted keys — object keys must be quoted strings
(
{"name": "Ada"}, not{name: "Ada"}. -
Comments —
//and/* */are not allowed in standard JSON. - Extra text — trailing characters after a complete value, or two top-level values in one paste, will fail parse.
-
Unescaped characters — newlines or quotes inside
strings must be escaped (for example
\n,\").
How this tool surfaces errors
Paste or type JSON in the left editor. If
JSON.parse fails, the editor shows a parse status with the
error message. When the browser reports a location, the tool derives a
line and column and lets you jump to that spot in the
source.
The tree on the right does not update until the document parses successfully. A short hint there also reminds you to fix the JSON in the editor first. Your document stays in the browser; this tool does not upload it to fix syntax for you.
Fix checklist
- Paste or load the JSON into the viewer editor.
- Read the parse status. If a line/column is shown, jump to that position.
- Check for trailing commas, quote style, comments, and unquoted keys near that location.
- Confirm there is a single top-level value and that strings escape special characters.
- When the error clears, the tree updates — then you can beautify, search, or edit as usual.
Or return to the homepage tool · Privacy Policy