JSON Validator
Valid JSON uses double-quoted strings and has no trailing commas and no comments. The validator reports Valid JSON, or the line and column of the error.
How to use
- Paste your JSON into the input box.
- Press Validate. The status says Valid JSON, or shows the error with its line and column.
- When there is an error, the cursor jumps to that spot in the input box. Fix it and the status updates as you type.
- Once it is valid, you can also use Format or Minify on the same text.
How it works
Validation means running the text through the JSON parser built into your browser. If it parses, the JSON is valid. If not, the parser throws an error that names the problem and, in most browsers, the character position, which this tool converts to a line and column.
This checks syntax as defined by the JSON standard: double-quoted strings, no trailing commas, no comments, and only objects, arrays, strings, numbers, true, false and null. It does not check the data against a schema, so it cannot tell you whether a field is missing or has the wrong type.
Safari words some errors without a position. In that case only the message is shown and the cursor does not move.
What valid JSON allows
- Values: object, array, string, number, true, false, null.
- Strings use double quotes, with escapes such as \n and \u00e9.
- Numbers have no leading plus sign or extra leading zeros, and no NaN or Infinity.
- Whitespace between tokens is ignored.
FAQ
Does this validate against a JSON Schema?
No. It checks syntax only: whether the text is well-formed JSON. Schema checks, such as required fields or types, need a schema validator.
Is my data sent to a server?
No. The check runs in your browser with the built-in JSON parser, so your text never leaves your device.
Why does a JavaScript object fail here?
JSON is stricter than JavaScript. Keys and strings need double quotes, trailing commas are not allowed, and comments, undefined and functions are not part of JSON.
Are empty values like {} and [] valid?
Yes. A lone value such as 5, "text", true or null is valid JSON too. Only an empty input is reported as invalid.