JSON格式校验工具

JSON校验工具

校验结果

FAQ

What is JSONLint?

JSONLint is a validator and reformatter for JSON, a lightweight data-interchange format.

Why 'Lint'?

Essentially, I'm just riding on JSLint's coattails. The name 'lint' was originally used to find problems in C source files. It's not really valid here because JSON is just a protocol. Shameless? You bet!

What are some common errors?

Expecting 'STRING'

You probably have an extra comma at the end of your collection. Something like: { "a": "b", }

Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

You probably have an extra comma at the end of your list. Something like: [ "a", "b", ]
You also may have not enclosed your collection keys in quotes. Proper format for a collection is: { "key": "value" }

A friend and I pasted the same JSON in and got different results. Wat do?

If you and your friend are on different systems (Win/Unix), this is possible due to the way windows handles newlines. Essentially, if you have just newline characters (\n) in your JSON and paste it into JSONLint from a windows machine, it can validate it as valid erroneously since Windows may need a carriage return (\r) as well to detect newlines properly.

The solution: Either use direct URL input, or make sure your content's newlines match the architecture your system expects!