# What is JSON? The Complete Specification, Syntax & Data Types Guide
**JavaScript Object Notation (JSON)** is an open standard, lightweight, language-independent data interchange format defined by **RFC 8259** and **ECMA-404**. It uses human-readable text to serialize and transmit structured data consisting of attribute-value pairs and ordered arrays.
Since Douglas Crockford formalized the format in the early 2000s, JSON has completely replaced XML as the primary communication payload format for modern REST APIs, GraphQL endpoints, NoSQL databases, and client-server architectures.
---
## 1. Core Syntax Rules of JSON
To guarantee that your JSON payloads parse predictably across all programming languages, your data must adhere strictly to these core syntax rules:
1. **Double Quotes for Keys and Strings**: JSON requires double quotation marks (`"`). Single quotes (`'`) will trigger fatal parsing errors in standard parsers like `JSON.parse()`.
2. **Key-Value Pairs**: Data is always represented as `"key": value`, separated by a colon.
3. **Comma Separation**: Elements inside objects and arrays must be separated by a comma (`,`).
4. **No Trailing Commas**: Standard JSON forbids trailing commas after the last item in an array or object. (If your project uses comments or trailing commas, use our [JSONC to JSON Converter](/tools/jsonc-to-json)).
5. **UTF-8 Encoding**: Standard JSON is encoded in UTF-8 natively without a Byte Order Mark (BOM).
---
## 2. The 6 Native JSON Data Types
JSON supports exactly six data types. Any complex domain structure must be expressed using these primitives:
| Data Type | Description | Valid Example |
| :--- | :--- | :--- |
| **String** | Sequence of zero or more Unicode characters wrapped in double quotes. | `"Hello, World!"` |
| **Number** | Double-precision floating point number (no octal or hex). | `42`, `3.14159`, `-18` |
| **Boolean** | Logical literal written strictly in lowercase. | `true` or `false` |
| **Null** | Represents an intentional absence of value. | `null` |
| **Object** | Unordered collection of key/value pairs enclosed in curly braces. | `{ "id": 1, "active": true }` |
| **Array** | Ordered sequence of zero or more values enclosed in square brackets. | `["apple", "banana", "cherry"]` |
---
## 3. What JSON Does NOT Support
Understanding what is excluded from the JSON specification is just as important as knowing what is supported:
- **No Comments**: Standard JSON does not permit `//` or `/* */` comments.
- **No Functions or Methods**: JSON represents static state, not executable logic.
- **No Date Primitives**: Dates are serialized as ISO 8601 strings (e.g. `"2026-10-31T15:00:00Z"`).
- **No Undefined**: JavaScript's `undefined` primitive is illegal in valid JSON.
- **No Circular References**: An object cannot reference itself; circular references cause recursive parser loops.
---
## 4. Best Practices for Production JSON APIs
When designing JSON payloads for production microservices:
1. **Minify in Production**: Always strip whitespace before transmission across public networks using our [JSON Minifier](/tools/json-minifier) to reduce wire size and egress costs.
2. **Standardize Key Casing**: Pick either `camelCase` (standard in JavaScript/TypeScript) or `snake_case` (standard in Python/Ruby) and maintain consistency across your entire API surface.
3. **Validate Payloads**: Enforce strict validation on incoming webhooks with our [JSON Validator](/tools/json-validator) to prevent malformed injections.
4. **Leverage Type Generation**: Avoid hand-writing types; generate strongly-typed contracts automatically with our [JSON to TypeScript Converter](/tools/json-to-typescript).
Technical Guide • 8 min read • Published 2026-10-31
What is JSON? The Complete Specification, Syntax & Data Types Guide
A comprehensive developer reference to JSON (JavaScript Object Notation). Learn RFC 8259 syntax rules, primitive data types, common pitfalls, and validation techniques.
🛠️
Interactive Tools Mentioned in this Guide
Test your JSON data and execute the techniques discussed above with our free in-browser developer utilities:
JSON Formatter / Beautifier
Paste raw JSON and get indented readable JSON
JSON Minifier
Remove all whitespace to compress JSON to one line
JSON Validator
Check if JSON is valid and show the exact error location
JSON Viewer (Tree View)
View JSON as a collapsible tree with search
AI JSON Generator (HERO)
Generate JSON from a plain-English description — homepage hero