JSON Validator
Check JSON syntax against RFC 8259 and get the precise line, column and cause of the first error.
JSON to check
Validation result
A rejected config file, a webhook the receiver silently drops, a deploy that fails with nothing but SyntaxError: Unexpected token } in the logs — the fix is usually one character, and the entire task is finding it. This validator parses your document with the browser's native JSON.parse and reports the first fault with its line and column, so you can go straight there instead of bisecting the file by hand.
When the document does parse, you get more than a green tick: a summary of what the parser actually saw — the root type, how many objects, arrays and scalar values it contains, and the maximum nesting depth. That is a fast way to confirm a payload holds the twelve records you expected rather than one record and an empty array, without reading a single line of it.
How to use the json validator
- 1
Paste or upload the document
Drop in the JSON you want to check. Nothing is transmitted anywhere; the parser runs locally in a Web Worker.
- 2
Read the verdict
Valid documents report Valid JSON (RFC 8259) plus the structure summary. Invalid ones report the parser's own description of the fault together with the line and column where it was detected.
- 3
Fix in place and re-check
Edit directly in the input pane and validate again. Parsing stops at the first fault, so a badly damaged file will surface its problems one at a time as you work down it.
What RFC 8259 actually permits
JSON is a small specification, and most validation failures come from assuming it is slightly larger than it is. The complete grammar allows six value types — object, array, string, number, true/false, and null — and nothing else. In particular:
- Strings must use double quotes. Single quotes are a syntax error, in keys and values alike.
- Object keys must be quoted strings. Bare identifiers such as
{name: "x"}are JavaScript, not JSON. - There are no comments. Neither
//nor/* */is legal anywhere in a JSON document. - A trailing comma after the last element of an object or array is invalid.
NaN,Infinity,-Infinityand hexadecimal or leading-zero numbers are all outside the number grammar. Onlytrue,falseandnullare permitted as bare literals, and they are lower case.- A leading byte order mark is not part of the document and will cause the parse to fail on the very first character.
Two things that surprise people by being legal: duplicate keys, and a bare scalar as the whole document. {"id":1,"id":2} parses fine and the last value wins silently, which makes duplicate keys a genuinely dangerous bug rather than a loud one. And 42, "hello" or null on their own are each a complete, valid JSON document under RFC 8259 — the older RFC 4627 required an object or array at the top level, which is why some legacy parsers still reject them.
Syntax validation is not schema validation
This tool answers one question: does the text parse as JSON? It deliberately does not claim to answer the other one: does this document contain the right fields, of the right types, within the right ranges? That question can only be answered against a JSON Schema, and asserting validity without one would be dishonest.
The practical consequence is that a document can pass here and still be rejected by the API you send it to, because quantity arrived as the string "3" instead of the number 3, or a required currency field is missing entirely. Syntax is the floor. The structure summary this tool prints — root type, counts, depth — is often enough to catch that class of mistake by eye, but it is not a substitute for a schema check in your pipeline.
The awkward cases
Truncated files. If a download or a log capture was cut short, the error will point at the very end of the document and complain about an unexpected end of input. That is the parser telling you the file is incomplete, not that the last line is wrong.
Smart quotes. JSON pasted out of a word processor, a ticketing system or a chat client frequently has " and " in place of ". They look almost identical in a proportional font and are a hard syntax error. If the reported column looks like it is pointing at a perfectly ordinary quote mark, this is usually why.
Invisible characters. A non-breaking space or a zero-width space copied along with the text is not valid JSON whitespace and will fail at a position that appears blank.
JSON Validator FAQ
Why does it only report one error at a time?
JSON parsing is sequential and stops at the first fault, because everything after an unbalanced brace is ambiguous — the parser cannot know whether you meant to close the object or open another. Fix the reported error and re-run to reveal the next one.
Can I validate against a JSON Schema?
No. This tool checks syntax against RFC 8259 only. Schema validation requires you to supply the schema, which this tool does not currently accept, and any tool that claims to "validate" arbitrary JSON without one is checking syntax and calling it something grander.
My JSON is valid here but my application rejects it. Why?
Almost always a semantic rather than a syntactic problem: a type mismatch, a missing required field, a date in an unexpected format, or a number that exceeds the receiver's limits. It can also be an encoding issue — the file must be UTF-8, and a stray BOM or a Latin-1 accented character will break a strict server-side parser even after the text looks fine in a browser.
Are duplicate keys reported?
They are not flagged as errors, because RFC 8259 permits them. JSON.parse keeps the last occurrence, so the duplicate disappears from the structure summary and from any formatted output. If you suspect duplicates, format the document and compare the key count with the original.
Is there a size limit?
Ten megabytes. Work happens on your own device in a background thread, so throughput depends on your hardware; a few megabytes validates in well under a second on typical laptops.
