Sample JSON Data for Testing: Employees, Students, API Responses and More

8 min·Nov 22, 2026
AI Summary

Sample JSON data for testing: employees (with nested address, skills array and a null manager), students (with a grades object and ISO dates), products with variants, and a paginated API response. A Postman raw JSON body needs Content-Type: application/json. mongoimport needs --jsonArray for a top-level array, or one document per line (JSONL). Power BI reads JSON via Get Data → JSON and needs "To Table" then Expand on records. Generate large files with a short script rather than by hand. Use example.com emails and never production data.

Sample JSON Data (Employees, Students, Products)
Ready-to-copy sample JSON data for testing: employees with departments, students with grades, and products with nested variants. Covers every JSON type: strings, numbers, booleans, null, nested objects, arrays and ISO dates.
{
  "departments": [
    {
      "id": "ENG",
      "name": "Engineering",
      "location": "Bengaluru"
    },
    {
      "id": "SAL",
      "name": "Sales",
      "location": "London"
    },
    {
      "id": "HR",
      "name": "People",
      "location": "New York"
    }
  ],
  "employees": [
    {
      "id": 1001,
      "name": "Asha Rao",
      "email": "[email protected]",
      "department": "ENG",
      "title": "Engineering Manager",
      "salary": 145000,
      "currency": "USD",
      "isActive": true,
      "hiredAt": "2019-04-01",
      "manager": null,
      "skills": [
        "go",
        "kubernetes",
        "hiring"
      ],
      "address": {
        "city": "Bengaluru",
        "country": "IN",
        "postalCode": "560001"
      }
    },
    {
      "id": 1002,
      "name": "Daniel Okafor",
      "email": "[email protected]",
      "department": "ENG",
      "title": "Senior Software Engineer",
      "salary": 128000,
      "currency": "USD",
      "isActive": true,
      "hiredAt": "2021-09-13",
      "manager": 1001,
      "skills": [
        "typescript",
        "react",
        "postgres"
      ],
      "address": {
        "city": "Lagos",
        "country": "NG",
        "postalCode": "100001"
      }
    },
    {
      "id": 1003,
      "name": "Mia Fischer",
      "email": "[email protected]",
      "department": "SAL",
      "title": "Account Executive",
      "salary": 92000,
      "currency": "USD",
      "isActive": false,
      "hiredAt": "2022-01-10",
      "manager": null,
      "skills": [
        "negotiation",
        "crm"
      ],
      "address": {
        "city": "London",
        "country": "GB",
        "postalCode": "EC1A 1BB"
      }
    }
  ],
  "students": [
    {
      "id": "S-001",
      "name": "Liam Chen",
      "age": 20,
      "enrolledAt": "2024-08-26T09:00:00Z",
      "course": "Computer Science",
      "grades": {
        "math": 91,
        "physics": 84,
        "programming": 97
      },
      "scholarship": true
    },
    {
      "id": "S-002",
      "name": "Priya Nair",
      "age": 19,
      "enrolledAt": "2025-08-25T09:00:00Z",
      "course": "Economics",
      "grades": {
        "math": 78,
        "statistics": 88,
        "writing": 92
      },
      "scholarship": false
    }
  ],
  "products": [
    {
      "sku": "TSHIRT-BASIC",
      "name": "Basic T-Shirt",
      "price": 19.99,
      "inStock": true,
      "tags": [
        "apparel",
        "cotton"
      ],
      "variants": [
        {
          "size": "M",
          "color": "black",
          "stock": 42
        },
        {
          "size": "L",
          "color": "white",
          "stock": 0
        }
      ]
    },
    {
      "sku": "MUG-12OZ",
      "name": "Ceramic Mug 12oz",
      "price": 9.5,
      "inStock": true,
      "tags": [
        "kitchen"
      ],
      "variants": []
    }
  ]
}

Most people searching for "sample JSON" need the same few shapes: a list of people, some nested data, and an API response. Every example below is valid JSON you can paste straight into a parser, database or test.

Sample employee JSON

An array of objects, each with every JSON type: string, number, boolean, null, nested object and array.

[ { "id": 1001, "name": "Asha Rao", "email": "[email protected]", "department": "Engineering", "salary": 145000, "isActive": true, "hiredAt": "2019-04-01", "manager": null, "skills": ["go", "kubernetes"], "address": { "city": "Bengaluru", "country": "IN" } }, { "id": 1002, "name": "Daniel Okafor", "email": "[email protected]", "department": "Engineering", "salary": 128000, "isActive": true, "hiredAt": "2021-09-13", "manager": 1001, "skills": ["typescript", "react"], "address": { "city": "Lagos", "country": "NG" } } ]

manager holds another employee's id, which is how you model relationships in flat JSON. The top-level employee is null.

Sample student JSON

{ "students": [ { "id": "S-001", "name": "Liam Chen", "age": 20, "course": "Computer Science", "enrolledAt": "2024-08-26T09:00:00Z", "grades": { "math": 91, "physics": 84, "programming": 97 }, "scholarship": true }, { "id": "S-002", "name": "Priya Nair", "age": 19, "course": "Economics", "enrolledAt": "2025-08-25T09:00:00Z", "grades": { "math": 78, "statistics": 88 }, "scholarship": false } ] }

grades is an object (subject → score) rather than an array because each subject appears once. Use an array when order matters or keys repeat.

Nested JSON example

Deep nesting shows up in orders, configs and API payloads. This order has an object inside an array inside an object:

{ "orderId": "ord_8f3a2c", "customer": { "id": "cus_19b7", "shipping": { "line1": "12 MG Road", "city": "Bengaluru", "geo": { "lat": 12.9756, "lng": 77.6066 } } }, "items": [ { "sku": "TSHIRT-BASIC", "qty": 2, "options": { "size": "M", "color": "black" } } ] }

The JSON Pointer to the color is /items/0/options/color. In JavaScript it is order.items[0].options.color.

Sample API response JSON

A list endpoint usually wraps records in an envelope with pagination:

{ "data": [ { "id": "ord_8f3a2c", "status": "shipped", "total": { "amount": 5998, "currency": "USD" } } ], "meta": { "pagination": { "page": 1, "perPage": 20, "total": 37, "totalPages": 2 } }, "links": { "next": "https://api.example.com/v1/orders?page=2", "prev": null }, "errors": [] }

And the matching error response:

{ "data": null, "errors": [ { "code": "not_found", "message": "Order ord_999 does not exist", "field": "id" } ] }

Money is stored in cents (5998) to avoid floating-point rounding. The full version is in the Sample API Response template.

Sample JSON body for Postman

In Postman choose Body → raw → JSON, which sets Content-Type: application/json:

{ "name": "Asha Rao", "email": "[email protected]", "role": "admin", "sendWelcomeEmail": false, "tags": ["beta", "internal"] }

Use {{baseUrl}} or {{userEmail}} variables for values that differ per environment. Postman's dynamic variables such as {{$randomEmail}} generate fresh fake values on every send.

Importing sample JSON into MongoDB

mongoimport accepts two shapes:

# A file that is one big array mongoimport --db test --collection employees --file employees.json --jsonArray # A file with one document per line (JSON Lines) mongoimport --db test --collection employees --file employees.jsonl

Forgetting --jsonArray on an array file is the most common import error. See JSON vs JSONL for when to use which.

Loading sample JSON into Power BI

  1. Get Data → JSON and pick the file.
  2. Power Query shows a List. Choose To Table.
  3. Click the expand icon on the column to turn each record's fields into columns. Expand nested objects (like address) the same way.

Arrays inside records (like skills) expand into extra rows, so decide whether you need them before expanding. To style the report, see Power BI theme JSON.

Generating a large JSON file

For load tests you need thousands of rows. Generate them rather than writing them by hand:

import json, random depts = ["Engineering", "Sales", "People"] rows = [ { "id": i, "name": f"Employee {i}", "email": f"employee{i}@example.com", "department": random.choice(depts), "salary": random.randint(40_000, 180_000), "isActive": random.random() > 0.1, } for i in range(1, 10_001) ] with open("employees.json", "w") as f: json.dump(rows, f, indent=2)

For files over a few hundred MB, write JSON Lines instead so tools can stream them line by line.

Rules that keep sample data valid

  • Keys and strings use double quotes. Single quotes are invalid.
  • No trailing commas and no comments.
  • One root value per file (an object or an array).
  • Dates are ISO 8601 strings; JSON has no date type.
  • Use example.com emails and fake phone numbers. Never copy production records into fixtures.

Make it your own

Open the Sample JSON Data template in the studio and ask in plain English: "add 20 students with a city field", "give every product a discount price", or "write a JSON Schema for the employees array". Each change shows up as a diff you accept or reject.

FAQ

Where can I get free sample JSON data?

Copy the examples on this page or open the Sample JSON Data template in the studio and ask for more rows ("add 50 employees in Sales"). For a live fake API, public mock services such as JSONPlaceholder return JSON over HTTP.

What is an array of objects in JSON?

A top-level [ ... ] whose elements are { ... } objects with the same keys, for example a list of employees. It is the most common shape for tabular data and what most import tools expect.

Why does mongoimport fail on my JSON file?

If the file is one big array, add --jsonArray. Without it, mongoimport expects one JSON document per line (JSON Lines). Also check for trailing commas and comments, which strict JSON does not allow.

How do I send JSON in a Postman request body?

Body → raw → JSON. Postman then sets Content-Type: application/json. Paste an object like the Postman example below and use {{variables}} for values that change between environments.

Can JSON store dates?

No. JSON has strings, numbers, booleans, null, objects and arrays. Store dates as ISO 8601 strings like "2024-03-15T09:30:00Z" and parse them in your code.