🔨 All in one Utilities

Mock API JSON Generator

Great utilities that help you design, program and maintain your website

utilities for you to make a website
Home » Utilities » Mock API JSON Generator

Mock API JSON Generator

One field per line. Braces nest an object, brackets make an array of objects.

Same seed, byte-identical output.
Records
Size
Nulls generated

Note: A mock where every string is short, every array has three items and nothing is null tests nothing. The awkward cases here — the fifty-character name, the empty list, the missing field — are the ones that break a layout in production.

Mock data exists to make a front end fail before production does, and the mock most people write does the opposite. Every name is the same length, every string is short, every list has exactly three items, nothing is null and no field is missing. Then the real data arrives with a fifty-character company name, an empty array and a null where the API documentation promised a string, and the layout breaks.

This generates data that varies. Names run from short to long, some optional fields are genuinely absent rather than empty, arrays have a range of lengths including zero, and if you ask for nulls you get them scattered through rather than in a predictable place. That is what makes it useful for finding the layout problem while you are still building.

The seed makes a run reproducible. Without one, every regeneration produces different data, so a failing test cannot be re-run and a screenshot cannot be compared. With one, the same seed always produces byte-identical output, which is what a fixture file needs to be.

The schema syntax is deliberately small: a field name, a colon, and a type. Nested objects and arrays of objects are supported because real API responses are shaped that way, and a mock that is flat when the real response is nested tests almost nothing about how your code walks it.

Everything runs locally, so nothing here touches a network. That also means the output is yours to commit — a fixture file generated once and checked in is more useful than a tool that regenerates it differently every run.

Frequently Asked Questions

Why does my mock data include nulls and missing fields?

Because real API responses do, and a mock that never produces them lets you ship a front end that crashes on the first one. If you want clean data, turn the option off — but the layout problems it surfaces are cheaper to fix now than after release.

What is the seed for?

Reproducibility. The same seed always generates identical output, which is what makes the result usable as a checked-in fixture, a stable screenshot, or a test that can be re-run after it fails. Without one, every run differs.

Can I mock a nested response?

Yes. An object is written as a field with braces, and an array of objects as a field with brackets. Real responses nest, and a flat mock does not exercise the code that walks the structure — which is where the bugs usually are.

Is this data safe to use publicly?

The names, emails and addresses are assembled from generic word lists and are not real people's details. They are fine for demos and fixtures. Do not use them where a reader might mistake them for genuine records — a fabricated review or testimonial is a different thing entirely.

Related Utilities