← Cheat Sheets
JSON Rules and Pitfalls
What is and is not valid JSON.
# JSON Rules and Pitfalls
What is and is not valid JSON.
- Keys and strings use **double quotes** only
- No trailing commas, no comments
- Values: string, number, `true`, `false`, `null`, object, array
- No `undefined`, functions, or dates (use ISO 8601 strings)
- Numbers: no leading zeros, no `NaN` or `Infinity`
- Escape `"` as `\"` and newlines as `\n`
```json
{
"name": "Ann",
"age": 30,
"tags": ["a", "b"],
"address": { "city": "Oslo" },
"active": true,
"score": null
}
```