JSON Validator
Check whether a document is syntactically valid JSON. You get the parser's message, the location it stopped at, and a summary of the structure it found — without changing a single character of your input.
Runs entirely in your browser — your JSON is never uploaded.
How to validate a document
- Paste the document into the editor, or load one of the two samples: a valid configuration file and a broken one with a trailing comma.
- Press Validate JSON. The result replaces the placeholder below the editor.
- If the document is valid, a structure summary shows its top-level type, nesting depth and how many values were parsed.
- If it is not, the parser message is shown with the line and column where parsing stopped, the offending line of source, and possible causes.
Turning on Check as I type re-validates automatically after a short pause. It is disabled for documents above 100,000 characters so typing stays responsive.
Validator or formatter?
Both tools parse the document, so both catch syntax errors. The difference is what happens next. The formatter rewrites your text into an indented version, which is what you want when the goal is readability. This page never rewrites anything: it answers a yes/no question and, when the answer is no, explains what the parser objected to.
That makes it the better choice when you are debugging a payload from a log file or a failing request, where you care about the error and not about the formatting.
The rules a document has to follow
- One top-level value. An object, array, string, number, boolean or null — but only one, with nothing but whitespace around it.
- Double quotes only. Strings and property names must use straight double quotes. Single quotes and smart quotes are rejected.
- No trailing commas. A comma separates members; it must not follow the last one.
- No comments. JSON has no // or /* */ syntax. JSONC and JSON5 exist as separate formats.
- No bare words. NaN, Infinity, undefined and function calls are not values in JSON.
- Escaped control characters. A literal newline inside a string is invalid; use \n instead.
Reading a parser error
A strict JSON parser stops at the first byte it cannot accept. That is why the reported position often points slightly after the real mistake: a missing comma is only noticed when the parser meets the next key, and an unclosed brace is reported at the end of the file.
The usual order of investigation is: look at the reported line, check the character before the reported column, then walk outwards to the enclosing block. If the message mentions the end of the input, the problem is an unmatched opening brace, bracket or quote rather than the last line itself.
Browsers do not agree on error wording, and the same document can produce different messages in Chrome, Firefox and Safari. The line and column shown here come from your browser and are best treated as a pointer.
Why a structure summary helps
A document can be perfectly valid and still be wrong: an empty array where you expected data, a depth of twelve where you expected three, or 4,000 values where you expected 40. The summary shows those numbers immediately, which is often faster than scrolling through a collapsed tree in your browser's developer tools.