JSON Lint
Validate JSON and find syntax errors online.
About JSON Lint
JSON Lint checks that your JSON is valid as you type. When it isn't, you get the parser's exact message and position, so you can fix the problem instead of hunting for it.
- Paste or type your JSON into the editor, or click Import to load a file or URL.
- The badge updates as you type: Valid JSON, or Invalid JSON with the error message next to it.
- Invalid lines are marked in the editor's gutter - hover the marker for details.
- Press Ctrl + Enter or click Format to jump to the first error, or to pretty-print valid JSON.
- Use Sort or Minify once the JSON is valid.
- Need more than syntax? The JSON Inspector adds lint rules (duplicate keys, precision loss), type checks and schema validation.
- Trailing commas -
[1, 2,]- are not allowed in JSON. - Keys and strings need double quotes:
{"name": "Ana"}, not{name: 'Ana'}. - JSON has no comments; remove
//and/* */before parsing. - See common JSON errors and the JSON Lint guide for more.
Lint and Validate JSON Online
Linting means checking JSON against the rules of the format before a program has to. Paste your JSON and the editor tells you, as you type, whether it parses and exactly where it stops if it doesn't.
What JSON Lint catches
- Trailing and missing commas: a comma after the last item, or none between two items.
- Wrong quotes: single-quoted strings and unquoted keys, which JavaScript allows but JSON doesn't.
- Unclosed structures: a
{,[or string that is never closed. - Things JSON doesn't have: comments,
undefined,NaNand numbers with leading zeros.
When to lint JSON
- Before committing a config file such as
package.json - When an API rejects a request body as malformed
- After editing JSON by hand
- When a parser reports an error and you need the exact position
JSON Lint FAQ
What does "Unexpected token" mean?
The parser met a character that can't appear at that point - most often a trailing comma, a single quote, or a missing comma or bracket just before it. Look at the position in the message and the character right before it.
Does JSON Lint detect duplicate keys?
No. Repeating a key is legal JSON syntax, so the syntax check passes it. The JSON Inspector has lint rules that flag duplicate keys and other problems beyond syntax.
Can it validate JSON with comments or JSON5?
No. It checks strict JSON, where comments and JSON5 extras such as trailing commas are errors. Remove them first if the consumer expects standard JSON.
Is my data uploaded to a server?
No. Validation runs in your browser. JSON is only stored online if you click Share to create a link.