Toolskuy
All Tools

JSON Examples & Common Structures

JSON (JavaScript Object Notation) is the standard data format for APIs and configuration files. Here are real examples of every structure you'll encounter.

๐Ÿ”

Try the Free JSON Formatter & Validator โ†’

Format, validate, and minify any JSON in the browser

๐Ÿ“‹ JSON Data Types

TypeExampleNotes
String"Hello, World!"Always double quotes
Number42 or 3.14No quotes, decimal allowed
Booleantrue or falseLowercase only
NullnullLowercase only
Array[1, "a", true]Ordered list, mixed types ok
Object{"key": "value"}Key always must be a string

Simple Object

Key-value pairs. The most basic JSON structure.

{
  "name": "Alice",
  "age": 30,
  "isAdmin": false,
  "email": "alice@example.com"
}

Array of Values

Ordered list. Values can be any JSON type.

["apple", "banana", "cherry", 42, true, null]

Nested Object

Objects within objects for hierarchical data.

{
  "user": {
    "id": 1,
    "name": "Bob",
    "address": {
      "city": "Jakarta",
      "country": "Indonesia"
    }
  }
}

Array of Objects

Common pattern for lists of records (API responses).

[
  { "id": 1, "name": "Product A", "price": 9.99 },
  { "id": 2, "name": "Product B", "price": 14.99 },
  { "id": 3, "name": "Product C", "price": 4.99 }
]

API Response Pattern

Typical REST API response with status and pagination.

{
  "status": "success",
  "data": {
    "users": [
      { "id": 1, "name": "Alice" },
      { "id": 2, "name": "Bob" }
    ],
    "total": 2,
    "page": 1,
    "per_page": 10
  },
  "error": null
}

โš ๏ธ Common JSON Mistakes

โŒ Single quotes โ€” JSON requires double quotes: use "name" not 'name'

โŒ Trailing comma โ€” `{"a": 1,}` is invalid. Remove the last comma.

โŒ Comments โ€” JSON does not support // or /* */ comments.

โŒ Undefined โ€” JSON has no `undefined` type. Use `null` instead.

โŒ Unquoted keys โ€” All object keys must be in double quotes.

๐Ÿ› ๏ธ Related Developer Tools

JSON FormatterCSV โ†” JSON ConverterJWT DecoderURL Encoder/DecoderHTTP Status Codes