🎲 Mock JSON Generator
Generate realistic mock JSON data for testing APIs and UIs. Define a schema with types, arrays, and nested objects. Free online mock data generator — no signup needed.
How to Use
Build your schema
Click "Add Field" to add fields. Set a name for each field and choose a data type.
Set record count
Enter the number of records to generate (1–100) in the Records input.
Generate and copy
Click Generate to produce your mock data. Click Copy JSON or Download to use the output.
Frequently Asked Questions
Complete Guide: Mock JSON Generator
The Mock JSON Generator creates realistic, schema-driven fake data so you can build and test APIs, front-end components, and integrations without touching a production database. It produces properly structured JSON with convincing values for names, emails, dates, UUIDs, addresses, and dozens of other data types.
Why Mock Data Matters
Depending on a live backend during development creates a chain of problems: rate limits hit unexpectedly, test data bleeds into real records, and a slow staging environment stalls front-end work. Mock data breaks that dependency entirely. Your UI team can render a full list of 50 users while the back-end team is still designing the database schema.
Mock data is also essential for reproducible automated tests. A test that relies on live data can fail because a record was deleted or a field changed. A test that injects known fake data fails only when code logic is wrong — which is exactly the signal you want.
Schema-Based Generation
Instead of typing JSON by hand, you describe the shape of your data. A simple schema might look like this:
{
"id": "uuid",
"name": "fullName",
"email": "email",
"createdAt": "dateISO",
"active": "boolean"
}
The generator reads these type tokens and replaces each one with a realistic value. This mirrors how libraries like Faker.js and Chance.js work under the hood.
Realistic Data Types
A good mock generator covers far more than simple strings and numbers:
- Names — culturally plausible first/last name combinations
- Emails —
firstname.lastname@domain.tldpatterns, never real addresses - Dates — ISO 8601 strings, Unix timestamps, or locale-formatted dates
- UUIDs — RFC 4122 v4 random identifiers for primary keys and correlation IDs
- Addresses — Street number, street name, city, postal code
- Phone numbers — E.164 formatted or locale-specific patterns
- Lorem text — Paragraph-length placeholder copy
- Numbers — Integers and floats within configurable min/max ranges
- Booleans and enums — Random true/false or selection from a defined list
Nested Objects and Arrays
Real-world APIs rarely return flat objects. The generator supports nested structures:
{
"user": {
"id": "uuid",
"profile": {
"avatar": "imageUrl",
"bio": "sentence"
}
},
"posts": [
{
"title": "words(5)",
"body": "paragraph",
"tags": ["word", "word", "word"]
}
]
}
Use the repeat N option to wrap any object in an array of N items — ideal for simulating paginated list responses.
Seeded Randomness for Reproducible Tests
Random data is great for exploration, but automated tests need determinism. The generator accepts an optional seed value — an integer that initialises the pseudo-random number generator. The same seed always produces the same output, so you can commit expected JSON fixtures to your repository and assert against them reliably.
// Seed: 42 always produces the same name
{ "name": "Margaret Holloway" }
Using Mock JSON in API Clients
Once generated, mock JSON slots directly into popular API development tools:
- Postman — Paste into a mock server response or use it as example response body.
- Insomnia — Set as the response body for an environment variable-driven mock.
- MSW (Mock Service Worker) — Use it as the return value inside a
rest.get()handler for browser or Node.js API mocking. - JSON Server — Drop the generated array into
db.jsonfor an instant REST API.
Best Practices
- Keep field names in mock schemas identical to your real API contracts. Divergence causes subtle bugs when you switch to real data.
- Generate edge-case data too — very long strings, zero-length arrays, null values — to stress-test your UI components.
- Version your seed-locked fixtures alongside your tests so failures are always reproducible in CI.
Related Tools
Before sending mock data to an API, validate its structure with the JSON Formatter. If your schema uses UUIDs as primary keys, the UUID Generator can supply consistent base values for seeded fixtures.