Mock JSON Generator

Define a simple field list with types and row count to generate a deterministic sample JSON array for testing APIs and frontends.

Mock JSON Generator

Define a simple field list with types and row count to generate a deterministic sample JSON array for testing APIs and frontends.

Add fields with a name and type (string, number, boolean, or date), set how many rows you need, and get a ready-to-paste JSON array. Values are deterministic, so the same schema always produces the same sample data — ideal for repeatable tests and demos. Copy the output straight into your code or API client.

[
  {
    "id": 100,
    "name": "Name 1",
    "active": true,
    "createdAt": "2024-01-01T00:00:00.000Z"
  },
  {
    "id": 200,
    "name": "Name 2",
    "active": false,
    "createdAt": "2024-01-02T00:00:00.000Z"
  },
  {
    "id": 300,
    "name": "Name 3",
    "active": true,
    "createdAt": "2024-01-03T00:00:00.000Z"
  },
  {
    "id": 400,
    "name": "Name 4",
    "active": false,
    "createdAt": "2024-01-04T00:00:00.000Z"
  },
  {
    "id": 500,
    "name": "Name 5",
    "active": true,
    "createdAt": "2024-01-05T00:00:00.000Z"
  }
]

How to use this calculator

  1. Add fields using the + Add field button; each field gets a name and a type (string, number, boolean, or date).
  2. Remove any field you do not need with the remove button.
  3. Enter the number of rows (1 to 100).
  4. Click Generate to build the JSON array.
  5. Click Copy JSON and paste it into your code, tests, or API client.

Worked example

A schema with id (number) and name (string) at 2 rows produces [{‘id’:100,‘name’:‘Name 1’},{‘id’:200,‘name’:‘Name 2’}] — deterministic, so regenerating gives the exact same array.

Frequently Asked Questions

What does deterministic sample data mean?

Deterministic means the same inputs always produce the same output: the same field list and row count will generate byte-identical JSON every time. This matters for testing, because your tests, snapshots, and demos behave consistently instead of breaking on random data. If you change the schema or row count, the data changes predictably.

How are the sample values generated?

Each type follows a simple index-based rule so the pattern is obvious. Strings become the capitalized field name plus the row number (‘Name 1’, ‘Name 2’). Numbers become the row number times 100 (100, 200, 300). Booleans alternate true, false, true. Dates start at 2024-01-01 and advance one day per row in ISO 8601 format. The values are clearly synthetic, so nobody mistakes them for real user data.

What field types are supported?

Four types: string, number, boolean, and date. The set is intentionally small — it covers the vast majority of mock-data needs while keeping the output deterministic and the UI simple. Nested objects and arrays are not supported; for complex payloads, generate the flat rows here and wrap them in your own structure. Every field requires a non-empty, unique name.

Can I use this for load testing?

For small-scale tests, yes — generate up to 100 rows per run and repeat as needed. For serious load testing with thousands of records, you will want a scripted faker library that streams data instead of rendering it in a browser. This tool is optimized for the common case: a handful of realistic rows to develop and demo against.

Why not just use random data?

Random data makes tests flaky and demos unpredictable — a demo that shows different data on every reload is hard to present. Deterministic data also diffs cleanly: if your output changes, you know your code changed, not the fixture. When you genuinely need randomness, add it in your own code after copying the stable base data from here.