August 6, 2026

JSON Syntax Rules

JSON Syntax Rules

JSON is famous for being simple, but it is also very strict. A single misplaced character will invalidate the entire file.

The Golden Rules

  1. Data is in name/value pairs.
  2. Data is separated by commas.
  3. Curly braces hold objects.
  4. Square brackets hold arrays.
  5. Strings must use double quotes.
  6. Keys must be strings (and therefore in double quotes).

Valid Data Types

JSON values must be one of the following data types:

  • String: "Hello World"
  • Number: 42 or 3.14 (no quotes)
  • Object: {"key": "value"}
  • Array: [1, 2, 3]
  • Boolean: true or false (no quotes)
  • Null: null (no quotes)

Note: JSON does not support undefined, functions, or dates natively.

Check if your JSON follows these rules using our JSON Validator.