Paste JSON and find out whether a strict parser will accept it. This page answers one question — is it valid, and if not, where — without reformatting your document in the process.
Strict on purpose
NaN, Infinity and hexadecimal numbers are all rejected. Every one of them is legal JavaScript, which is why they turn up so often in files people believe are JSON.
Being strict is the point: a permissive validator that accepts your file tells you nothing about whether the service you are sending it to will.
What counts as valid at the top level
true, false or null. A bare "hello" is valid JSON. Two objects one after another are not — that is JSON Lines, a different format, and it needs to be split by line before each part will validate.Duplicate keys
{"a": 1, "a": 2} is valid JSON by the specification, which does not forbid duplicate names. Almost every parser silently keeps the last one. If your document has duplicates, it will validate here and still behave unpredictably in the wild — the specification calls the behaviour undefined for good reason.Other names for this
Also searched as “check json”, “json syntax checker”, “is my json valid”.
Questions
- It says my file is invalid but my editor opens it fine.
- Your editor is probably parsing it as JavaScript or JSON5, which allow comments and trailing commas. Strict JSON does not.
- Can it validate against a JSON Schema?
- No — this checks syntax only. Validating a document against a JSON Schema is a different job: it needs the schema as a second input and answers a different question, which is whether the data is correct rather than whether it is well-formed.
- Does my text leave the browser?
- No. Everything runs as JavaScript in this tab — there is no server involved and no request is made. Open the Network panel and watch, or turn your Wi-Fi off and keep using the tool.