JSON rules in one minute
- Strings and keys use double quotes. Escape
"and\inside them with a backslash. - Values are strings, numbers,
true,false,null, objects or arrays. Noundefined,NaN, dates or functions. - No trailing commas and no comments (that's JSON5 or JSONC, which VS Code settings use).
- Numbers have no leading zeros or
+sign; very large integers lose precision in JavaScript beyond 253.
The format is defined by RFC 8259 and ECMA-404. On the command line, jq . file.json pretty-prints and python -m json.tool file.json validates. Need a value out of a JSON string with a pattern? Try it in the regex tester — though for anything nested, parse it instead.