JSON Cheat Sheet

Access the ultimate JSON cheat sheet for quick reference. Covering syntax, structure, and usage, this guide is perfect for developers and beginners alike.

Basic
Types
{
    "string": "Hello, World!",
    "integer": 25
}
String
{
    "single-quoted": "Hello, World!",
    "no-quotes": "Hello, World!"
}
Numbers
{
    "float": 3.14
}
Arrays
Array
[
    "item1",
    "item2",
    "item3"
]
2D Array
[
    [1, 2, 3],
    [4, 5, 6]
]
Objects
Objects of Objects
{
    "parent": {
        "child1": "value1",
        "child2": "value2"
    }
}
Array of Objects
[
    {
        "name": "John",
        "age": 30
    },
    {
        "name": "Jane",
        "age": 25
    }
]
Objects of Array
{
    "object_with_array": {
        "key": ["item1", "item2"]
    }
}
Access JSON
Access Object
{
    "key": "value"
}
Access Array
[
    "item1",
    "item2"
]
Access Array of Objects
[
    {
        "name": "John",
        "age": 30
    }
]
Access Nested
{
    "parent": {
        "child": "value"
    }
}
Full Featured Example
{
    "defaults": {
        "adapter": "postgres",
        "host": "localhost"
    },
    "development": {
        "adapter": "postgres",
        "host": "localhost",
        "database": "dev_db"
    },
    "array": [
        "item1",
        "item2"
    ],
    "object_with_array": {
        "key": ["item1", "item2"]
    },
    "nested": {
        "parent": {
            "child": "value"
        }
    }
}

Shortcut Keys