JSON Validator
Validate JSON and see exactly where and why it is invalid, with line, column and a fix hint. Runs in your browser: nothing you paste is uploaded.
Paste JSON, open a file, or load an example to get started. Validation runs as you type.
Processed locally in your browser. Your data never leaves your device.
About this JSON validator
This validator parses your JSON with a strict RFC 8259 parser and tells you the first place it stops being valid: the line and column, a plain-language description of what it found, a hint on how to fix it, and a few lines of context with a caret under the exact character. Use Go to error to jump the cursor there. If the JSON is valid it shows what it contains: the kind of value, how many keys, and how deep it nests.
How to use it
- Paste JSON, drop or open a file, or try one of the invalid examples to see how errors are reported.
- Read the result under the heading. It updates as you type, and screen readers hear a short Valid or Invalid announcement.
- Fix the reported problem and watch the next one appear, until the JSON is valid.
The most common JSON errors
Almost every invalid document fails for one of these reasons.
- Trailing comma:
{"a": 1,}or[1, 2,]. Remove the last comma. - Single quotes:
{'a': 'b'}. Use double quotes for keys and strings. - Unquoted keys:
{a: 1}. Write{"a": 1}. - Comments:
// noteand/* note */are not allowed. - NaN, Infinity, undefined: not JSON values. Use
nullor a string. - Leading zeros or plus signs:
007and+5. Write7and5. - Missing comma between properties or items, or a missing colon after a key.
- Raw line breaks or tabs inside a string. Write
\nand\tinstead. - Two documents in one input. JSON allows a single top-level value; for JSON Lines, validate one line at a time.
- A non-breaking space pasted from a web page or a chat app, which looks like a space but is not one.
Warnings: valid, but worth knowing
Two things are legal JSON but often surprising, so they are reported as warnings without failing validation. A duplicate key is allowed by the syntax, but most parsers silently keep only the last value. An integer beyond 253 (about 9 quadrillion), or a number too large for a double, cannot be represented exactly by JavaScript, so a browser or Node.js program would round it. Consider sending such identifiers as strings.
JSON versus JavaScript objects
A JavaScript object literal is not JSON. It may use single quotes, unquoted keys, trailing commas, comments and values like undefined. If your input came from code or a log line rather than an API, that is the usual reason it fails here.
Frequently asked questions
- Does it check my JSON against a schema?
- No. It checks syntax: whether the text is well-formed JSON as defined by RFC 8259. Checking that a document has the right fields and types is a job for JSON Schema tooling.
- Why does it show only one error?
- A syntax error usually makes everything after it unreliable, so the first error is the one to fix. Fix it and the next one, if any, appears immediately.
- Is a bare value such as "hello", 42 or null valid JSON?
- Yes. Since RFC 8259, any JSON value is a valid document; it does not have to be an object or an array. Some older parsers still insist on one of the two.
- What is the difference between JSON, JSON5 and JSONC?
- JSON5 and JSONC add conveniences such as comments, trailing commas and unquoted keys. This validator is strict: those extensions are reported as errors, because plain JSON parsers reject them.
- Is my data sent anywhere?
- No. Validation runs in your browser. Nothing you paste or open leaves your device.