JSON Format Cheatsheet

Complete JSON reference: syntax, data types, structures, parsing, and validation.

ConceptDescriptionSyntaxExampleCategory
ObjectCollection of key-value pairs{ "key": value }{ "name": "John", "age": 30 }Structure
ArrayOrdered list of values[ value1, value2 ][ 1, 2, 3 ] or [ "a", "b", "c" ]Structure
StringText value with quotes"text""Hello World"Data Types
NumberInteger or float123 or 45.6742 or 3.14159Data Types
BooleanTrue or falsetrue | false{ "active": true }Data Types
NullEmpty or no valuenull{ "value": null }Data Types
Nested ObjectObject within object{ "key": { } }{ "user": { "name": "John" } }Structure
Nested ArrayArray within array[ [ ], [ ] ][ [1, 2], [3, 4] ]Structure
JSON.parse()Convert string to object (JS)JSON.parse(jsonString)const obj = JSON.parse('{"a": 1}')Parsing
JSON.stringify()Convert object to string (JS)JSON.stringify(object)const str = JSON.stringify({a: 1})Parsing