Sample JSON Files to Download

Pick an example dataset, check it in the preview, then download it as a .json file or copy it. Generated in your browser.

Download a sample JSON file

This page gives you three small, valid sample JSON files you can download in one click: a list of users, a product catalogue, and a nested, paginated API response. They are built to be read by a person in a few seconds while still exercising the parts of JSON that break tools: arrays inside objects, objects inside arrays, decimals, booleans and nested pagination fields. Each file is pretty-printed with two-space indentation, saved as UTF-8 with the application/json type, and contains only made-up data.

How to download

  1. Choose a dataset in the Sample dataset menu. The formatted JSON appears in the box below it.
  2. Click Download JSON to save it. The file is named after the dataset: users-sample.json, products-sample.json or nested-sample.json.
  3. Or click Copy to put the JSON on your clipboard and paste it straight into a tool, a test or an HTTP client.

What is in each file

users-sample.json

[
  {
    "id": 1,
    "name": "Ada Lovelace",
    "email": "ada@example.com",
    "roles": [
      "admin",
      "author"
    ]
  },
  {
    "id": 2,
    "name": "Grace Hopper",
    "email": "grace@example.com",
    "roles": [
      "author"
    ]
  }
]

A top-level array of records with integer IDs, email-shaped strings on the reserved example.com domain, and a roles array whose length differs per record. It is the classic shape for testing JSON to CSV (how does a converter flatten roles?), table views, and list rendering in a front end.

products-sample.json

[
  {
    "sku": "NJ-001",
    "name": "JSON Toolkit",
    "price": 19.99,
    "inStock": true
  },
  {
    "sku": "NJ-002",
    "name": "API Notebook",
    "price": 9.5,
    "inStock": false
  }
]

String identifiers, decimal prices and a boolean in both states. Use it to check number formatting (9.5 must not become 9.50 or "9.5"), boolean handling in spreadsheets, and typed model generation with JSON to TypeScript, where price should come out as number and inStock as boolean.

nested-sample.json

{
  "status": "ok",
  "requestId": "sample-001",
  "data": {
    "page": 1,
    "total": 2,
    "items": [
      {
        "id": 101,
        "tags": [
          "json",
          "api"
        ]
      },
      {
        "id": 102,
        "tags": [
          "testing"
        ]
      }
    ]
  }
}

A typical REST envelope: status and request ID at the top, pagination fields in data, and the records two levels down. This is the file to use for path queries and for anything that has to walk nested structures.

Worked examples with the sample files

Query the nested file. Paste nested-sample.json into the JSONPath tester and run $.data.items[*].id. The result is [101, 102]. Run $..tags[*] to collect every tag from every item: ["json", "api", "testing"].

Flatten the users file. Paste users-sample.json into JSON to CSV or JSON to table. The scalar fields map cleanly to id, name and email columns; the interesting part is the roles array, which has two items in the first record and one in the second, so you can see at a glance how the converter fits a variable-length list into a fixed grid.

Load a file in code.

// Node.js
const users = JSON.parse(require('fs').readFileSync('users-sample.json', 'utf8'));
console.log(users[0].roles);   // [ 'admin', 'author' ]

# Python
import json
with open('nested-sample.json', encoding='utf-8') as f:
    doc = json.load(f)
print(doc['data']['total'])    # 2

Edge-case JSON to add to your test suite

The three files are deliberately clean. A robust parser or converter should also be tested against valid but awkward JSON. Save these as extra files:

{"": "empty key", "a b": "space in key"}
{"big": 12345678901234567890, "exp": 1.5e-7, "neg": -0}
{"escaped": "line\nbreak \"quoted\" 茅 馃榾"}
{"deep": [[[[[[[[[[1]]]]]]]]]]}
[]
"just a string"

They cover empty and unusual keys, numbers beyond 253 (see JSON big integer precision), scientific notation, escaped characters and emoji surrogate pairs, deep nesting, and documents whose root is not an object. Invalid samples such as {"a": 1,} are equally useful to confirm that your tool reports errors; the trailing comma guide lists the error messages browsers produce.

Need more or bigger data?

These files are small on purpose and are not a benchmark. For many realistic rows with names, emails, addresses, dates and UUIDs, use the mock data generator, which exports JSON, CSV or SQL. For a single object with a fresh random id and timestamp, use the JSON generator. To read a large file you already have, open it in the JSON viewer, and to check a file you edited, run it through the JSON formatter and validator.

Frequently asked questions

Are these sample JSON files free to use?

Yes. The data is invented for testing, contains no real personal information, and can be used in tests, documentation, tutorials and demos without attribution.

Is the downloaded file valid JSON?

Yes. Each file is produced with JSON.stringify, so it is strict RFC 8259 JSON: double-quoted keys, no comments and no trailing commas.

What encoding and file extension are used?

Files are saved as UTF-8 with the .json extension and the application/json media type, which every JSON parser and editor accepts.

Can I get a larger sample JSON file?

Not from this page. Generate as many rows as you need with the mock data generator, or duplicate the records in the users or products file in a script.

Is anything uploaded when I download?

No. The JSON is built in your browser and the download is created locally from it.