"category": "inspect-and-test",

Mock JSON Data Generator

"tldr": Paste one sample record and generate up to 1,000 mock records with the same structure - names, emails, IDs, and dates faked realistically.

Paste one sample record and generate up to 1,000 randomized mock records with the same structure. Generation is field-aware: keys containing "name" get realistic names, "email" gets valid-looking addresses, "id" gets sequential or random identifiers, ISO date strings get random timestamps, and numbers stay in a plausible range around your sample.

{"tool": "mock-generator"}

Mock data unblocks the work that waits on real data: seeding a development database, stubbing an API before the backend exists, populating a UI to test layouts with realistic value lengths, and writing tests that need volume without production records - or their privacy problems.

How to generate mock JSON data

  1. 1Paste a single sample record (or an array - its first element is used as the template).
  2. 2Set how many records you want (1 to 1,000).
  3. 3Click Generate - each record keeps the exact structure with randomized, field-aware values.
  4. 4Copy the array or download it as mock-data.json for your fixtures or seed script.

Convert Template to Mock data in code

JavaScript (@faker-js/faker)
import { faker } from "@faker-js/faker"; // npm install @faker-js/faker

const users = Array.from({ length: 100 }, () => ({
  id: faker.string.uuid(),
  name: faker.person.fullName(),
  email: faker.internet.email(),
  createdAt: faker.date.past().toISOString(),
}));
Python (Faker)
from faker import Faker  # pip install faker

fake = Faker()
Faker.seed(42)  # reproducible
users = [
    {"id": i, "name": fake.name(), "email": fake.email()}
    for i in range(100)
]

Frequently asked questions

How does the generator decide what fake value to use?

By key-name heuristics: "email" produces addresses, "name" produces person names, "id" produces identifiers, "phone", "url", "city", "country", and "color" get matching fakes, and strings that look like ISO dates get random timestamps. Unrecognized string fields get neutral word pairs; numbers and booleans randomize within type.

Is the generated data safe to commit to a repository?

Yes - every value is synthesized from built-in word lists, never derived from real records. That is the point: fixtures with production data leak PII into git history forever; generated fixtures carry no such risk.

Can I get the same data every time (a fixed seed)?

This tool randomizes on every run - for reproducible fixtures, generate once and commit the file, which also keeps tests deterministic. If you need seeded generation in code, faker libraries support it: faker.seed(42) in both the JS and Python ecosystems.

What about relationships between records, like foreign keys?

Fields named like IDs are numbered sequentially per batch, which gives you stable references for simple joins. For real relational fixtures (orders pointing at existing user IDs), generate each entity separately and wire the keys in a small script - see the code examples.

Last updated:

You might also need

Free and in-browser, like everything on JSON Console. Browse all tools →