JSON Examples

JSON syntax highlighting

JSON Examples

Basic JSON Object

Simple object with various value types:

{ "name": "John Doe", "age": 30, "active": true, "balance": 123.45, "address": null }

JSON Array

Array with mixed types:

[ 1, 2, 3.14, "string", true, false, null ]

Nested Structure

Complex nested objects and arrays:

{ "user": { "id": 12345, "username": "johndoe", "email": "john@example.com", "profile": { "firstName": "John", "lastName": "Doe", "bio": "Software developer" } }, "posts": [ { "id": 1, "title": "First Post", "published": true, "likes": 42 }, { "id": 2, "title": "Second Post", "published": false, "likes": 0 } ], "metadata": { "created": "2025-10-26T12:00:00Z", "version": "1.0.0" } }

Scientific Notation

Numbers with scientific notation:

{ "smallNumber": 1.23e-10, "largeNumber": 6.022e23, "negative": -2.5e-3, "positive": 1.5E+5 }

API Response Example

Typical REST API response structure:

{ "status": "success", "code": 200, "data": { "items": [ { "id": "abc123", "type": "product", "attributes": { "name": "Widget", "price": 29.99, "inStock": true, "quantity": 150 } } ], "total": 1, "hasMore": false }, "timestamp": "2025-10-26T14:30:00.000Z" }