JSON validator
Validate JSON online and see the line and column of the first syntax error. Uses strict JSON.parse rules, checks as you type, and nothing leaves your browser.
About JSON validator
The JSON validator checks whether text is valid JSON and, when it is not, tells you what went wrong and where. Paste a payload or open a file and the result appears straight away: “Valid JSON” in the status bar, or an error message with the line and column of the first problem in browsers that report a position.
Validation follows the JSON standard strictly, the same way JSON.parse does in JavaScript. That catches the mistakes that slip into hand-edited files: trailing commas, comments, single quotes, unquoted keys and missing brackets. Valid input is also shown pretty-printed, so you can scan its structure once it passes.
How to use JSON validator
- Paste JSON into the input box, or open or drop a .json file.
- Check the status bar: “Valid JSON” means the input parsed successfully.
- If an error appears, go to the reported line and column and fix the problem directly in the input box.
- Copy or download the formatted output once the JSON is valid.
Features
- Checks strict JSON syntax as defined by RFC 8259 and implemented by JSON.parse.
- Shows the parser’s error message with line and column when the browser reports a position.
- Validates as you type, with no button to press.
- Shows valid input indented with 2 spaces, with 4 spaces, tabs or minified output one click away.
- Handles inputs up to 2 MB without uploading them.
Common uses
- Finding the stray comma that stops a config file from loading.
- Checking a request body before sending it to an API that only answers “400 Bad Request”.
- Verifying JSON produced by a script or template before shipping it.
- Testing fixtures and mock data before adding them to a test suite.
Tips
- The reported position is where the parser noticed the problem, which can be just after the real mistake. If that line looks correct, check the end of the previous line for a missing comma or quote.
Frequently asked questions
Does it validate against a JSON Schema?
No. It checks syntax only, meaning whether the text is well-formed JSON. It does not check required fields, value types or allowed ranges defined in a JSON Schema, so valid output can still be rejected by an API with stricter rules.
Are trailing commas allowed in JSON?
No. A comma after the last item in an object or array, as in [1, 2,], is a syntax error in standard JSON, even though JavaScript, JSON5 and many editors accept it. Remove the final comma to make the input valid.
Can JSON contain comments?
Standard JSON has no comment syntax, so // and /* */ comments cause an error. Some tools, such as VS Code settings and tsconfig.json, accept a JSON-with-comments variant, but strict parsers reject those files. Remove the comments before validating.
Why is the error on a line that looks correct?
Parsers report the point where the input stopped making sense, not where the mistake was made. A missing comma or closing quote on one line is often only detected at the start of the next value. Check the line before the reported position too.
Are duplicate keys invalid?
The JSON standard says names should be unique but does not forbid duplicates, so the validator accepts them. When the JSON is parsed, the last value wins and earlier ones are dropped from the formatted output. Rename or remove duplicates if every value matters.
Is my input uploaded?
Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.
Your privacy comes first
Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.