1. Fundamental JSON Syntax Rules
- Double Quotes Only
All object keys and string values MUST be wrapped in double quotes (
"key"). Single quotes ('key') cause instant syntax errors. - No Trailing Commas
Commas separate items in objects and arrays. Adding a comma after the final item (
{"a": 1,}) is invalid in strict JSON. - Strict Data Types
JSON supports only 6 data types: string, number, object, array, boolean, and null. Functions, comments, and undefined are not allowed.
- Unicode UTF-8
JSON text must be encoded in UTF-8. Special control characters within strings must be backslash-escaped.
2. Supported JSON Data Types
| Data Type | Syntax Specification | Valid Example |
|---|---|---|
| String | Zero or more Unicode characters in double quotes | "Hello World\n" |
| Number | Integer or floating point, optionally exponent (e/E) | 42, -3.14, 1.2e+10 |
| Object | Unordered key/value pairs enclosed in curly braces {} | { "id": 1 } |
| Array | Ordered sequence of values enclosed in square brackets [] | [ "apple", 12, true ] |
| Boolean | Literal true or false (lowercase) | true / false |
| Null | Literal null representing empty value | null |
3. Common Syntax Errors vs Correct JSON
{
name: 'JSON-Arch', // Invalid: unquoted key & single quote
"active": True, // Invalid: capitalized True
"tags": ["seo",], // Invalid: trailing comma
// comment here // Invalid: comments not allowed
}{
"name": "JSON-Arch",
"active": true,
"tags": ["seo"]
}Need to validate or fix your JSON syntax right now?
Use our free, client-side tools to detect missing quotes, remove trailing commas, and format invalid JSON instantly in your browser:

