JSON Validator Free Online
Free online JSON validator. Paste any JSON and instantly check for syntax errors with detailed error messages.
Formatted output...
A single character error in a JSON document - a misplaced comma, a missing quote, or an unescaped backslash - breaks the entire document and causes parsing failures. Tracking down these errors manually in large JSON files can take significant time. This free JSON validator identifies syntax errors instantly, shows you exactly where the problem is with line and character position information, and highlights the issue so you can fix it in seconds.
How to Use the JSON Validator
Paste your JSON
Paste the JSON you want to validate into the input area. The JSON can be minified (all on one line), pretty-printed with indentation, or partially malformed. The validator accepts any JSON regardless of its current formatting state - it validates the syntax directly without requiring any particular indentation style.
Check the validation result
The validator runs automatically as you type or paste. If the JSON is valid, you see a green "Valid JSON" indicator and the formatted output appears in the right panel. If the JSON contains a syntax error, a red error message appears showing the type of error, the line number, and the character position where the error was detected.
Fix errors and revalidate
Use the error location information to find and fix the issue in your JSON. After correcting the error, the validator immediately re-runs and shows the updated validation status. You can iterate on this fix-and-validate cycle until all syntax errors are resolved and you see the "Valid JSON" confirmation.
Common JSON Syntax Errors Detected
The validator checks for all syntax errors defined by the JSON specification (RFC 8259). The most common errors it catches are:
Trailing commas - a comma after the last element in an object or array is invalid JSON but valid JavaScript. This is the single most common JSON error, especially when copy-pasting from JavaScript object literals. Example: {"name": "John", "age": 30,} - the comma after 30 is the error.
Single quotes - JSON requires all strings (keys and values) to be enclosed in double quotes. Single quotes are not valid in JSON even though they are valid in JavaScript. {"name": 'John'} is invalid JSON - it must be {"name": "John"}.
Unquoted keys - JSON requires all object keys to be strings in double quotes. JavaScript object literal syntax allows unquoted keys, but JSON does not. {name: "John"} is invalid JSON - it must be {"name": "John"}.
Mismatched brackets - every opening { or [ must have a corresponding closing } or ]. A missing or extra bracket breaks JSON parsing. The validator identifies where the bracket mismatch occurs.
Unescaped special characters in strings - double quotes inside a string must be escaped as \". Backslashes must be escaped as \\. Newlines in strings must be represented as \n. Literal unescaped versions of these characters break JSON parsing.
Invalid number formats - JSON numbers cannot start with a leading zero (01234 is invalid - use 1234), cannot have a trailing decimal point (1. is invalid), and cannot be NaN or Infinity.
JSON Validator vs JSON Formatter
Both tools validate JSON, but they serve different primary purposes. The JSON Validator focuses specifically on identifying and explaining syntax errors - it is optimised for debugging malformed JSON and finding the exact location of problems. The JSON Formatter also validates JSON but focuses on presenting valid JSON in a readable, indented format with syntax highlighting. Use the validator when you have broken JSON you need to fix; use the formatter when you have valid JSON you want to read.