JSON-Arch Logo
JSON-Arch
Specification RFC 8259 / ECMA-404

JSON Syntax Rules & Specification Guide

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format defined by RFC 8259. While simple to write, strict syntax rules govern key quotes, trailing commas, and character escaping.

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 TypeSyntax SpecificationValid Example
StringZero or more Unicode characters in double quotes"Hello World\n"
NumberInteger or floating point, optionally exponent (e/E)42, -3.14, 1.2e+10
ObjectUnordered key/value pairs enclosed in curly braces {}{ "id": 1 }
ArrayOrdered sequence of values enclosed in square brackets [][ "apple", 12, true ]
BooleanLiteral true or false (lowercase)true / false
NullLiteral null representing empty valuenull

3. Common Syntax Errors vs Correct JSON

Invalid JSON Syntax
{
  name: 'JSON-Arch',   // Invalid: unquoted key & single quote
  "active": True,      // Invalid: capitalized True
  "tags": ["seo",],    // Invalid: trailing comma
  // comment here       // Invalid: comments not allowed
}
Valid RFC 8259 JSON
{
  "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: