JSON Validator
Validate JSON and get the exact line and column of the first syntax error — trailing commas, unquoted keys, missing brackets. Nothing is uploaded.
Worked examples
- Valid JSON object
Confirms well-formed JSON passes cleanly with no error location, which is what most people check before shipping a config file.
- Trailing comma before a closing brace
Trailing commas are valid in JavaScript object literals but not in JSON — this is the single most common copy-paste mistake the validator catches.
- Unquoted object key
JSON requires double-quoted keys; pasting a JavaScript object literal instead of JSON is the second most common source of 'invalid JSON' errors.
What this tool does
This validator checks whether a piece of text is syntactically valid JSON. If it isn't, it tells you exactly where the parser gave up — the line and column of the first problem — instead of just saying "invalid." That's the difference between a validator you can actually use to fix a file and one that just confirms something is wrong.
When you need it
- A request body, config file or API response fails to parse and you need to find the exact character causing it, not just know "it's broken."
- You're hand-editing a JSON file and want to check it before saving, the way an IDE's built-in linter would.
- You're debugging generated JSON (from a template, a string-concatenation bug, or a copy-paste from a non-JSON source like a JavaScript console) and need to locate the first place it diverges from valid JSON.
Rules the validator applies
- It checks syntax only, not structure. A validator confirms the text can be parsed as JSON at all — matched braces and brackets, correctly quoted keys and strings, valid number formats. It does not check whether the data has the fields or types your application expects; for that, you'd need a JSON Schema validator.
- It reports the first error only. JSON parsers stop at the first syntax problem they encounter, so later parts of the document can't be reliably checked until the first issue is fixed — this mirrors how every JSON parser in every language behaves, not a limitation specific to this tool.
- Line and column numbers are 1-indexed, matching how most code editors number lines, so you can jump straight to the reported location.
The two most common failures
Trailing commas. {"a": 1, "b": 2,} is valid in a JavaScript object literal but not in JSON — the comma after the last value has to go. This is the single most frequent reason JSON pasted from a JavaScript codebase fails to validate.
Unquoted keys. {name: "atlas"} is also valid JavaScript but not JSON — every key must be wrapped in double quotes. Single quotes around strings are invalid for the same reason: JSON requires double quotes throughout.
Both of these come from the same root cause: JSON is a strict subset of JavaScript object-literal syntax, and code that "looks like JSON" copied out of a .js file or a browser console frequently isn't actually valid JSON.
Things to check after validating
-
Duplicate keys in one object (
{"a": 1, "a": 2}) are not a syntax error under RFC 8259, so they pass; the parser keeps the last value. If you need to catch them, check the source by eye. -
The error wording and position come from your browser's own JSON parser, so they differ slightly between Chrome, Firefox and Safari. If a browser's message carries no position, the tool falls back to line 1, column 1 rather than guessing.
-
If the file is valid but your application still rejects it, the problem is almost certainly structural (missing required fields, wrong types) rather than syntactic — that needs schema validation, not this tool.
-
If the reported error location looks wrong, check for non-printing characters (a stray tab, a non-breaking space) copied in from a rich-text source like a word processor or a chat app.
Limits
Input can be empty (which reports as invalid, matching what JSON.parse("") does) up to 2 MB. Only the first syntax error is reported; fix it and re-validate to find the next one, if any.
Frequently asked questions
- Is my JSON uploaded anywhere?
- No. Validation runs entirely in your browser; nothing is sent to a server.
- Does this check my data against a schema?
- No — this checks only that the text is syntactically valid JSON. For validating structure and types, use a JSON Schema validator instead.
- Why does it report only the first error?
- JSON parsers stop at the first syntax problem, so later text can't reliably be checked until that one is fixed.
- What's the most common reason JSON is invalid?
- Trailing commas and unquoted object keys — both valid in JavaScript object literals but not allowed in JSON.