JSON Validator
Checks whether a file is legal JSON and points at the first place the grammar breaks, down to the line and column. It all runs in your tab; the text is never sent anywhere.
Ctrl / Cmd + Enter formats as well.
Click any { } or [ ] to collapse or expand it. The number beside a bracket is its item count, so an empty array is obvious at a glance. Rendering stops at 5,000 nodes.
Paste JSON into the Format & validate tab first.
Supported: $, .key, ..key (recursive descent), [0] and [*]. That is the subset developers actually use, not the whole JSONPath grammar.
Compared structurally, not as text. Indentation, key order and 1.0 vs 1 are not reported as differences.
The data comes from the input box on the Format & validate tab. Supported: type, required, properties, items, enum, const, numeric bounds, string length and pattern, array length and uniqueness, and additionalProperties. Not supported yet: $ref, allOf/anyOf/oneOf and format.
A validator answers one question: does this parse as a single JSON value under RFC 8259. It says nothing about whether the content is what your API expected — that is schema validation, a separate check on a separate page.
Most validators in this category just relay the engine's message. Current V8 frequently reports something like Unexpected token '@', … is not valid JSON — a fragment of your text and no position. This page carries its own scanner for exactly that case, so you get a line and a column instead. Measured in Chrome 152 / Windows 11: a fault on line 2,419,794 of a 100 MB file is located in 1026 ms.
What this rejects
- A byte-order mark before the first character. UTF-8 is required by the spec; a BOM is not whitespace.
- Comments —
//and/* */. Legal in JSONC, which is whattsconfig.jsonand VS Code settings use. - Trailing commas in an object or array.
- Single-quoted strings, and keys without quotes.
NaN,Infinity,-Infinity,undefined.- Raw control characters inside a string — a literal newline instead of
\nis the usual one. - Two values at the top level, including newline-delimited JSON (JSONL). Each line of a JSONL file is valid; the file is not one JSON document.
- An empty file, or whitespace only. There has to be a value.
And what it accepts that surprises people: duplicate keys.
{"a":1,"a":2} is valid JSON, and the last value wins. That is legal, not a
typo the validator will flag.
Syntax checking and schema checking are not the same thing
| Syntax validation | Schema validation | |
|---|---|---|
| Question answered | Is this JSON at all? | Is this JSON the shape I expected? |
| Needs | nothing else | a schema document |
| Fails on | a trailing comma | a missing required field |
| This site | this page | JSON Schema validator |
Order matters: a schema check on text that is not JSON is meaningless, so the schema page parses first and reports the syntax error if there is one.
Frequently asked questions
Is my JSON sent to a server?
No. There is no request in the code path — the text is parsed in a Web Worker inside the same tab. No request this page makes carries your document.
Can it check my JSON against a schema?
Not on this page. This one only answers "is it valid JSON". Schema validation is a separate tool and it is a draft-07 subset — see the JSON Schema validator page for what is and is not implemented.
The error says a position like 148203. How do I find that?
Older engines printed a character offset; you were left counting. This page prints line and column, plus the surrounding text of that line, because it locates the fault itself rather than relaying the engine.
Why does my .json file fail when the editor is happy with it?
The editor is probably reading JSONC or JSON5, which allow comments, trailing commas and unquoted keys. Those are not JSON. Either strip the extensions or keep the file named .jsonc.
Is an empty file valid JSON?
No. A JSON text must contain exactly one value, and an empty file contains none. Neither is {} equivalent — if you want "nothing", write null.