JSON Examples: Simple Beginner-Friendly JSON Samples

JSON examples are one of the fastest ways to understand how JSON works. This guide covers simple JSON objects, arrays, nested structures and API-style examples with beginner-friendly explanations.

Last updated: May 2026 Reading time: 7 minutes Reviewed for accuracy
Quick answer:
  • JSON stores data using key-value pairs.
  • JSON supports objects, arrays, strings, numbers, booleans and null.
  • Nested JSON structures are common in APIs.
  • Most modern web APIs return JSON.

Simple JSON example

Here is a simple JSON object:

{
  "name": "Jane Smith",
  "role": "Chief Cheese Tester",
  "active": true
}

This JSON object contains:

  • A string value
  • A boolean value
  • Three key-value pairs
Simple idea:

Think of JSON like a labelled lunchbox. Every label has a value inside it. Sometimes the value is simple, and sometimes it contains another lunchbox full of cheese-related mysteries.

JSON array example

Arrays store ordered lists of values.

{
  "tools": [
    "JSON Formatter",
    "JSON Viewer",
    "XML to JSON Converter"
  ]
}

The tools property contains an array with three values.

Nested JSON example

JSON objects can contain other objects and arrays.

{
  "company": {
    "name": "CheeseBridge",
    "employees": [
      {
        "name": "Mia Cheese",
        "role": "Bridge Snack Coordinator"
      },
      {
        "name": "Barry Cheddar",
        "role": "Senior Cheese Engineer"
      }
    ]
  }
}

Nested JSON structures are extremely common in APIs and applications.

JSON API response example

Many modern APIs return JSON responses similar to this:

{
  "status": "success",
  "data": {
    "id": 101,
    "name": "Jane Smith",
    "subscription": "premium"
  }
}

API responses often include:

  • Status information
  • Nested objects
  • Arrays of records
  • Error messages

JSON data types

Type Example
String "CheeseBridge"
Number 42
Boolean true
Object { "name": "Jane" }
Array [1, 2, 3]
Null null

Invalid JSON example

JSON must follow strict formatting rules.

{
  "name": "Jane Smith",
  "role": "Chief Cheese Tester",
}

This JSON is invalid because of the trailing comma after the last property.

Common JSON mistakes

  • Using single quotes instead of double quotes
  • Adding trailing commas
  • Missing commas between properties
  • Leaving property names unquoted
  • Adding comments inside JSON

JSON vs XML example

Here is the same data represented in XML.

<employee>
  <name>Jane Smith</name>
  <role>Chief Cheese Tester</role>
</employee>

JSON is usually shorter and easier to read for APIs, while XML supports additional features such as attributes and namespaces.

Format or view JSON online

Use CheeseBridge JSON tools to format, inspect and validate JSON directly in your browser.

Open JSON Formatter Open JSON Viewer Open XML to JSON Converter Open JSON to XML Converter

Trusted JSON references

For official and technical references, see:

Frequently asked questions

What is a JSON object?

A JSON object stores data using key-value pairs inside curly braces.

What is a JSON array?

A JSON array stores ordered lists of values inside square brackets.

Why do APIs use JSON?

APIs commonly use JSON because it is lightweight, readable and easy for applications to parse.