Skip to content
Devtools 360

Validate JSON and Find Syntax Errors

Paste a JSON document or open a .json file to get a clear pass or fail verdict. When parsing fails, the offending line is shown with a caret under the exact column, so you can fix it without hunting.

Runs in your browserFree · No sign-up

How to validate JSON

  1. Paste JSON into the input box, click Sample to see a broken example, or open a .json file (up to 20 MB).
  2. The verdict updates as you type: a green "Valid JSON" message or an error panel.
  3. For invalid input, read the message and the excerpt of the failing line — the caret marks the column where parsing stopped.
  4. For valid input, check the summary of top-level type, key count, nesting depth and size.

Supported formats

Input
JSON, .json file
Output
Validation report
Maximum size
20 MB per file (limited by your device's memory)

Reading the error position

The parser reports where it gave up, which is not always where the mistake is. A missing comma is reported at the start of the next value, and an unclosed string or bracket is reported at the very end of the document. If the caret points at something that looks correct, inspect the line just before it. Once the document is valid, the JSON Formatter can re-indent it for reading.

Benefits

  • Shows the failing line with a caret instead of only a character offset.
  • Summarises valid documents (type, keys, objects, arrays, depth) so you can sanity-check structure.
  • Uses the browser's own strict JSON.parse, so the verdict matches what your JavaScript code will accept.

Limitations

  • Checks syntax only; it does not validate against a JSON Schema.
  • Safari's error messages do not include a position, so line and column may be missing in that browser.
  • Duplicate keys are accepted silently, as JSON.parse keeps the last value.

Privacy and security

Validation uses JSON.parse in this browser tab. Pasted text and opened files are read locally and never uploaded or stored.

Read our privacy policy for details about the site as a whole.

Frequently asked questions

Why does valid JavaScript fail as JSON?

JSON is stricter than JavaScript object literals: keys must be double-quoted, strings cannot use single quotes, trailing commas and comments are not allowed, and values like undefined, NaN or functions do not exist in JSON.

Is an empty object or a bare number valid JSON?

Yes. Since RFC 7159 any JSON value can be the top level, so {}, [], 42, "text", true and null are all valid documents.

Can it validate against a schema?

No. This tool checks that the text is well-formed JSON. Checking required fields or value types against a JSON Schema needs a schema validator.