🎲 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

1

Build your schema

Click "Add Field" to add fields. Set a name for each field and choose a data type.

2

Set record count

Enter the number of records to generate (1–100) in the Records input.

3

Generate and copy

Click Generate to produce your mock data. Click Copy JSON or Download to use the output.

Frequently Asked Questions

What is mock data used for? +
Mock data is used during development and testing when real data is unavailable. It lets you build and test UI components, populate databases for demos, test APIs with sample payloads, and create presentations without using sensitive production data.
What field types are available? +
Available types: firstName, lastName, fullName, email, phone, address, city, country, date, dateTime, number, float, boolean, UUID, username, URL, IP address, color, and lorem ipsum text.
How many records can I generate? +
You can generate 1 to 100 records at a time. Each record is a JSON object with the fields you defined.
Is the generated data realistic? +
Yes — names, emails, and phones follow realistic patterns. Names are drawn from a built-in dataset of common first and last names. Emails are generated using the first/last name if those fields exist in your schema.
Can I download the generated JSON? +
Yes — click Download JSON to save the output as a .json file. You can also click Copy to copy it to your clipboard for pasting into your project or API testing tool.


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:

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:

  1. Postman — Paste into a mock server response or use it as example response body.
  2. Insomnia — Set as the response body for an environment variable-driven mock.
  3. MSW (Mock Service Worker) — Use it as the return value inside a rest.get() handler for browser or Node.js API mocking.
  4. JSON Server — Drop the generated array into db.json for an instant REST API.

Best Practices

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.

🧰 50+ Tools