JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that uses human-readable key-value pairs and ordered lists to represent structured data. Originally derived from JavaScript, JSON has become the de facto standard for web APIs and configuration files across virtually all programming languages. While its syntax is deliberately minimal—supporting only six data types and disallowing comments or trailing commas—this simplicity ensures universal compatibility and predictable parsing. Understanding JSON's core rules, escape sequences, and edge cases around number precision, circular references, and encoding enables developers to work confidently with APIs, config files, and data pipelines.
What This Cheat Sheet Covers
This topic spans 22 focused tables and 195 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Syntax Elements
| Element | Example | Description |
|---|---|---|
{"name": "Alice", "age": 30} | • Unordered collection of key-value pairs enclosed in curly braces • keys must be double-quoted strings. | |
[1, "two", true, null] | • Ordered list of values enclosed in square brackets • elements can be of any JSON type. | |
"Hello, World!" | • Sequence of Unicode characters enclosed in double quotes • single quotes are invalid. | |
423.14-52.5e10 | • Integer or floating-point value in decimal notation • no leading zeros, supports scientific notation. | |
truefalse | • Literal values true or false• must be lowercase. |