JSON Validator
Validate JSON syntax instantly. Get clear error messages for invalid JSON. Free.
How to use this tool
- Enter json to validate in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your validation result and the full breakdown beneath it.
JSON Validator checks your JSON string for syntax errors and tells you exactly what went wrong.
How it works
JSON Validator checks whether a given string is syntactically valid JSON according to the ECMA-404 and RFC 8259 specifications. It parses the entire input and, if any error is found, reports the type of error and the location where parsing failed.
Paste any JSON string into the input field and click Validate. If the JSON is valid, you receive a confirmation along with the parsed structure. If it is invalid, you get a clear error message indicating exactly what went wrong, such as a missing comma, an unquoted key, or a trailing comma after the last element.
This tool is invaluable when debugging API responses, editing configuration files, or writing JSON by hand. Browsers and JSON parsers often produce cryptic errors; this validator translates them into actionable feedback so you can fix your JSON quickly.
Worked example
Find the error in a hand-written JSON config
- Copy your JSON config file contents.
- Paste them into the JSON to validate field.
- Click Validate.
- Read the error: Unexpected token } at line 5, column 3 -- trailing comma on line 4.
- Remove the trailing comma and re-validate to confirm the fix.
The validator identifies the exact line with the trailing comma so you can fix it immediately.
Common mistakes to avoid
- Using single quotes instead of double quotes for strings or keys: JSON requires double quotes; single-quoted strings are a JavaScript-only syntax that most JSON parsers reject.
- Adding JavaScript-style comments (// or /* */) to JSON: comments are not part of the JSON specification and will cause a parse error.
- Expecting the validator to fix the JSON automatically: the validator only reports errors; you need to correct them manually in your source.
Key terms
- JSON syntax
- The formal rules for structuring JSON: objects use curly braces with key-value pairs separated by commas, keys must be double-quoted strings, and arrays use square brackets.
- Trailing comma
- A comma after the last element in an array or object (e.g., [1, 2, 3,]). This is valid in JavaScript but illegal in strict JSON.
- Parse error
- An error thrown when a parser encounters input that does not conform to the expected syntax, preventing it from building a data structure from the text.
Frequently asked questions
- What makes JSON invalid?
- Common JSON errors include trailing commas, unquoted keys, single-quoted strings, and missing brackets.