merge pdf

Sample JSON Format Examples

Ready-to-use JSON templates for testing, development, and learning

1. Simple JSON Object

The most basic JSON format — a flat object with key/value pairs of different data types.

{
  "name": "John Doe",
  "age": 30,
  "isActive": true,
  "score": 98.5,
  "nickname": null
}
Format this JSON Validate this JSON

2. User / Person JSON

A realistic user object including personal details, contact information and account metadata.

{
  "id": "usr_7f3a9b2c",
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jane.smith@example.com",
  "phone": "+1-555-234-5678",
  "dateOfBirth": "1992-08-15",
  "gender": "female",
  "isEmailVerified": true,
  "isActive": true,
  "createdAt": "2023-01-10T09:30:00Z",
  "lastLoginAt": "2024-03-22T14:45:12Z",
  "roles": ["user", "editor"],
  "preferences": {
    "language": "en",
    "timezone": "America/New_York",
    "notifications": {
      "email": true,
      "sms": false,
      "push": true
    }
  }
}
Format this JSON

3. JSON Array of Objects

An array containing multiple user objects — the most common format returned by REST APIs.

[
  {
    "id": 1,
    "name": "Alice Johnson",
    "email": "alice@example.com",
    "department": "Engineering",
    "salary": 95000
  },
  {
    "id": 2,
    "name": "Bob Williams",
    "email": "bob@example.com",
    "department": "Marketing",
    "salary": 72000
  },
  {
    "id": 3,
    "name": "Carol Davis",
    "email": "carol@example.com",
    "department": "Engineering",
    "salary": 105000
  }
]
Convert to CSV Convert to XML

4. Nested JSON with Address

A deeply nested JSON object showing how addresses and relationships are commonly structured in APIs.

{
  "customerId": "C-10234",
  "fullName": "Mohammed Al-Rashid",
  "contact": {
    "email": "m.rashid@example.com",
    "phone": "+966-50-123-4567",
    "alternatePhone": null
  },
  "billingAddress": {
    "street": "123 King Fahd Road",
    "city": "Riyadh",
    "state": "Riyadh Province",
    "postalCode": "12345",
    "country": "SA"
  },
  "shippingAddress": {
    "street": "456 Olaya Street",
    "city": "Riyadh",
    "state": "Riyadh Province",
    "postalCode": "12346",
    "country": "SA"
  }
}
Format this JSON

5. REST API Response Format

A standard API response envelope with status, pagination metadata, and a data array — the format most production APIs return.

{
  "status": "success",
  "code": 200,
  "message": "Users retrieved successfully",
  "data": [
    { "id": 1, "name": "Alice", "email": "alice@example.com" },
    { "id": 2, "name": "Bob",   "email": "bob@example.com" }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 5,
    "pageSize": 2,
    "totalItems": 10
  },
  "meta": {
    "requestId": "req_8f2b3c",
    "timestamp": "2024-06-28T10:00:00Z",
    "version": "v2"
  }
}
Format this JSON

6. Product / Inventory JSON

A product record as you might find in an e-commerce catalog or inventory management API.

{
  "sku": "PRD-00842",
  "name": "Wireless Noise-Cancelling Headphones",
  "brand": "SoundMax",
  "category": "Electronics",
  "subcategory": "Audio",
  "description": "Premium wireless headphones with 30-hour battery life and active noise cancellation.",
  "price": {
    "original": 299.99,
    "sale": 249.99,
    "currency": "USD"
  },
  "stock": {
    "available": 145,
    "reserved": 12,
    "warehouse": "US-EAST-1"
  },
  "attributes": {
    "color": "Midnight Black",
    "connectivity": "Bluetooth 5.2",
    "batteryLife": "30 hours",
    "weight": "250g"
  },
  "tags": ["wireless", "noise-cancelling", "premium", "audio"],
  "images": [
    "https://cdn.example.com/products/prd-00842-front.jpg",
    "https://cdn.example.com/products/prd-00842-side.jpg"
  ],
  "rating": { "average": 4.7, "count": 1248 },
  "isAvailable": true,
  "createdAt": "2023-11-01T00:00:00Z"
}
Convert to CSV

7. E-commerce Order JSON

A complete order object with line items, shipping, payment, and status — as used in e-commerce APIs.

{
  "orderId": "ORD-2024-00512",
  "status": "processing",
  "placedAt": "2024-06-28T08:22:10Z",
  "customer": {
    "id": "usr_7f3a9b2c",
    "name": "Jane Smith",
    "email": "jane.smith@example.com"
  },
  "items": [
    {
      "sku": "PRD-00842",
      "name": "Wireless Headphones",
      "quantity": 1,
      "unitPrice": 249.99,
      "total": 249.99
    },
    {
      "sku": "PRD-00211",
      "name": "USB-C Charging Cable",
      "quantity": 2,
      "unitPrice": 12.99,
      "total": 25.98
    }
  ],
  "shipping": {
    "method": "Express",
    "carrier": "FedEx",
    "trackingNumber": null,
    "estimatedDelivery": "2024-07-01",
    "address": {
      "street": "456 Olaya Street",
      "city": "Riyadh",
      "country": "SA"
    }
  },
  "payment": {
    "method": "credit_card",
    "status": "captured",
    "subtotal": 275.97,
    "shipping": 9.99,
    "tax": 20.70,
    "discount": 0,
    "total": 306.66,
    "currency": "USD"
  }
}
Format this JSON

8. Application Config JSON

A typical application configuration file — database, cache, email, and feature flags in JSON format.

{
  "app": {
    "name": "MyApp",
    "version": "2.1.0",
    "environment": "production",
    "debug": false,
    "port": 8080
  },
  "database": {
    "host": "db.example.com",
    "port": 5432,
    "name": "myapp_prod",
    "pool": { "min": 2, "max": 10 }
  },
  "cache": {
    "driver": "redis",
    "host": "redis.example.com",
    "port": 6379,
    "ttl": 3600
  },
  "email": {
    "driver": "smtp",
    "host": "smtp.sendgrid.net",
    "port": 587,
    "from": "no-reply@myapp.com"
  },
  "features": {
    "darkMode": true,
    "betaSignup": false,
    "maintenanceMode": false
  },
  "rateLimiting": {
    "enabled": true,
    "maxRequests": 100,
    "windowSeconds": 60
  }
}
Convert to YAML

9. Blog Post / CMS JSON

A blog post or CMS article record — as used in headless CMS platforms like Contentful or Strapi.

{
  "id": "post_abc123",
  "slug": "how-to-format-json-online",
  "title": "How to Format JSON Online — A Complete Guide",
  "excerpt": "Learn how to use a free online JSON formatter to beautify, validate, and print JSON data in seconds.",
  "content": "JSON (JavaScript Object Notation) is the most widely used data format...",
  "author": {
    "id": "auth_99",
    "name": "Alex Chen",
    "avatar": "https://cdn.example.com/authors/alex-chen.jpg"
  },
  "category": "Developer Tools",
  "tags": ["json", "formatter", "tutorial", "developer tools"],
  "publishedAt": "2024-05-15T09:00:00Z",
  "updatedAt": "2024-06-01T12:00:00Z",
  "isPublished": true,
  "readingTimeMinutes": 5,
  "seo": {
    "metaTitle": "How to Format JSON Online",
    "metaDescription": "Step-by-step guide to formatting JSON online for free.",
    "canonicalUrl": "https://www.example.com/blog/how-to-format-json-online"
  }
}
Format this JSON

10. GeoJSON (Location Data)

The standard GeoJSON format for representing geographic features — used in maps, location APIs, and spatial databases.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [46.6753, 24.6877]
      },
      "properties": {
        "name": "Riyadh",
        "country": "Saudi Arabia",
        "population": 7676654
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-0.1276, 51.5074]
      },
      "properties": {
        "name": "London",
        "country": "United Kingdom",
        "population": 9002488
      }
    }
  ]
}
Validate JSON

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is based on a subset of JavaScript but is language-independent and supported by virtually every programming language.

JSON Data Types

TypeExampleDescription
String"Hello World"Text in double quotes
Number42 or 3.14Integer or float, no quotes
Booleantrue / falseLowercase only
NullnullEmpty / absent value
Object{"key": "value"}Key-value pairs in curly braces
Array[1, 2, 3]Ordered list in square brackets

Related Tools