Online JSON validator
The errors this catches: missing or trailing commas, unclosed brackets and braces, single quotes instead of double quotes, unquoted property names, comments (JSON has none), trailing content after the value, and truncated input. Each error message names the exact position — no more guessing which of 400 lines broke.
JSON formatter
Online JSON editor
The five JSON errors behind most red highlights
Almost every invalid file fails for one of five small reasons. The validator above points at the line where parsing broke, which is usually just after the actual mistake — so check the line before it too. Here are the usual suspects, broken then fixed:
- Trailing comma — JSON forbids a comma after the last item.
{"name": "Ada",}fails;{"name": "Ada"}works. - Single quotes — keys and strings must use double quotes.
{'name': 'Ada'}fails;{"name": "Ada"}works. - Unquoted keys — every key must be a quoted string.
{name: "Ada"}is JavaScript object syntax, not JSON;{"name": "Ada"}works. - Missing comma — two pairs run together with nothing between them.
{"a": 1 "b": 2}fails;{"a": 1, "b": 2}works. - Comments — JSON has no comment syntax at all.
{"a": 1 /* note */}fails; delete the comment. (Some editors accept a looser format called JSONC, but strict parsers and APIs do not.)
What a validator cannot catch
A green tick means the grammar is legal — nothing more. A validator cannot know that "age" should be a number rather than the string "36", that a key is misspelled ("emial" parses beautifully), that a value is wildly out of range, or that a required field is missing entirely, because all of that is meaning, and meaning belongs to the application reading the file. Watch duplicate keys, too: the JSON specification leaves their handling undefined, and most parsers quietly keep the last one, which can hide a real bug behind a valid file. Two smaller traps sit between the categories: an empty file, or one containing only whitespace, is not valid JSON even though nothing in it looks wrong; and a top-level value does not have to be an object or an array — a bare number, a string, or true on its own is perfectly legal JSON, which surprises people who expect braces. Validate first to rule out syntax, then test the data against the system that will actually consume it.