JSON Validator
Check whether JSON is valid and see the exact line and column of the first mistake, with a one-press fix for the common ones. Nothing leaves your browser.
Runs in your browser. Nothing you enter is uploaded.
How to use
This page tells you whether a piece of JSON is valid and, when it isn't, exactly where it goes wrong.
- Paste the JSON into JSON to check, or use Open a file. The verdict appears under the box a moment after you stop typing; Validate gives it at once.
- "Valid JSON." means any parser will accept it. Otherwise you get the line and the column of the first problem and a sentence about it, such as a missing comma or an unclosed bracket. Click the position to jump there in the text.
- Fix it and the verdict updates. Errors come one at a time, because after the first one a parser can't tell what the rest was meant to be.
- If the text is really JavaScript or Python, with single quotes, unquoted names, trailing commas, comments, True or None, Make it JSON rewrites it and lists what it changed.
- Once it's valid, Format lays it out with the indent you pick and Tree lets you walk through it.
The check is strict, as the standard is: names and strings in double quotes, no comma after the last item, no comments, no NaN or Infinity, and one value at the top.
A name that appears twice in one object is reported as a warning. It is legal, but most programs silently keep only the last value, which hides bugs.
Files over 500 KB are checked in the background when you press Validate, so the page doesn't stall. Nothing you paste is stored or sent.
Frequently asked questions
What are the most common JSON mistakes?
A comma after the last item, single quotes where double quotes are required, names without quotes, a missing comma between items, and comments. All five are fine in JavaScript, which is why hand-edited JSON breaks so often.
Does it validate against a JSON Schema?
No. It checks syntax: that the text is well-formed JSON. Whether a field is required or a number is in range is a schema's job, and this page doesn't read schemas.
Is JSON with duplicate keys valid?
Yes, by the letter of the standard, which only says names should be unique. In practice parsers disagree about which value wins, so the page flags every repeated name with its position for you to clean up.