This tool generates formatted, realistic mock JSON records for stubbing an API, seeding a UI, or writing tests. It produces ready-to-paste data for users, products and blog posts without any backend — everything runs in your browser.
How it works
Pick one of three templates and the generator builds that many records by drawing random values from curated lists (names, cities, roles, product words) and computed fields:
- user — id, uuid, firstName, lastName, email, city, role
- product — id, name, SKU, price, stock, rating
- post — id, title, author, views, slug
Numeric IDs increment from 1 so they stay unique across a batch, and UUIDs are produced with the browser’s secure crypto.randomUUID() so they are well-formed v4 UUIDs. You choose the record count and whether a single record is wrapped in an array.
Example output
Generating one user record produces JSON like:
{
"id": 1,
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"firstName": "Maya",
"lastName": "Patel",
"email": "[email protected]",
"city": "Lisbon",
"role": "editor"
}
A product batch of three might look like:
[
{ "id": 1, "name": "Wireless Speaker", "sku": "WS-4421", "price": 49.99, "stock": 34, "rating": 4.2 },
{ "id": 2, "name": "Desk Lamp", "sku": "DL-0087", "price": 29.95, "stock": 12, "rating": 3.8 },
{ "id": 3, "name": "Notebook Set", "sku": "NS-7760", "price": 12.00, "stock": 88, "rating": 4.6 }
]
When to use each template
| Template | Typical use case |
|---|---|
| user | Auth flows, user-listing UIs, admin dashboards, seeding user tables in tests |
| product | E-commerce frontends, catalog APIs, inventory seeders, filter/sort demos |
| post | Blog or CMS prototypes, search-result placeholders, feed UI mockups |
Practical patterns
Seeding a local database. Copy the array output and pipe it into a seed script. Because IDs are sequential and emails use example.com placeholder domains, the data imports cleanly without unique-constraint conflicts.
Mocking an API endpoint. Paste the JSON into json-server, MSW, or Mirage.js as a fixture file. The consistent field shapes mean your frontend components render without prop-type errors or missing-key warnings.
Writing component tests. Generate five or ten records with varied roles, cities, and ratings, then use them as the data prop in a Storybook story or a render() call. Because the data is random on each generation, running the tool again gives you a fresh batch to catch edge cases you might not have thought to write manually.
Demonstrating pagination. Generate 50 product records and use them to build a working paginated table demo. The sequential IDs and varied field values make it easy to demonstrate sort-by-price, filter-by-rating, or page-size changes without a backend.
Tips for clean mock data usage
- Keep mock data separate from your production code — import it only in test and Storybook files, not in app logic that runs in production.
- Use
example.comanddemo.ioemail domains (which this tool already uses) rather than real domains, to avoid accidentally sending test data to real email addresses during development. - If you need consistent data across test runs (for snapshot testing), generate once, commit the JSON file, and import it rather than regenerating each run.
All records are generated entirely in your browser; nothing is uploaded or stored.