ModernCalcs

API Mock Data Generator

Paste an example JSON object and generate realistic mock records matching its exact structure.

[
  {
    "id": "8ce37ec8-25d3-4232-b226-6321e12c97b1",
    "name": "Sam Johnson",
    "email": "sam.williams@test.org",
    "age": 33,
    "active": true,
    "signupDate": "2024-06-14T19:28:45.450Z",
    "tags": [
      "elit elit",
      "dolor elit"
    ]
  },
  {
    "id": "556a827c-80fd-492d-a47d-b412cdd3feb7",
    "name": "Taylor Brown",
    "email": "quinn.davis@demo.io",
    "age": 30,
    "active": false,
    "signupDate": "2025-12-14T00:45:32.218Z",
    "tags": [
      "dolor dolor",
      "ipsum lorem"
    ]
  },
  {
    "id": "80ed4134-e34b-411e-981a-1e154c1e1829",
    "name": "Riley Garcia",
    "email": "sam.wilson@example.com",
    "age": 19,
    "active": false,
    "signupDate": "2023-10-18T17:48:02.708Z",
    "tags": [
      "sed ipsum",
      "elit dolor"
    ]
  }
]

API Mock Data Generator: From One Example to Many

Testing a UI or writing integration tests against an API that doesn't exist yet (or isn't reachable) usually means hand-writing fake data — tedious, and easy to make unrealistic. This tool takes a single example JSON object and generates as many new, structurally-identical records as you need, with field-name-aware fake values rather than generic placeholders.

Formula
walk(example) → for each leaf: infer intent from field name + original type → generate matching realistic value

A field named 'email' gets a fake email address; a field named 'price' gets a plausible decimal amount — not just a random string or number.

Why Structure Preservation Matters

Random JSON generators that don't look at your actual data often produce a completely different shape than what your code expects — missing keys, wrong array depths, mismatched types. By walking your example's exact structure, every generated record has precisely the same keys, nesting, and array shapes as the original.

Field-Name Heuristics

A generic mock generator would fill a `price` field with any random number, potentially a value like 84719 — not remotely plausible for a currency amount. This tool checks the field name against common patterns (email, name, date, price, id, status, and more) so generated values look like something you'd actually see in a real API response.

Practical Examples

Generating Test Fixtures

Populating a test database with realistic user records.

  • 1.Paste one real (or hand-written) example user object
  • 2.Set Records to 10
  • 3.Copy the generated array as test fixture data

What's Preserved

  • Object keys and nesting structure
  • Array presence and approximate length
  • Original scalar type (string/number/boolean) per field

Good Use Cases

  • Populating a frontend with realistic data before a backend exists
  • Generating test fixtures for automated tests
  • Filling a staging/demo environment with plausible sample data
  • Stress-testing UI components with varied data shapes

Frequently Asked Questions

How does it know what kind of fake value to generate?

It walks your example JSON's structure recursively — preserving object keys and array lengths — and for each leaf value, generates a replacement guided by both its original type (string/number/boolean) and its field name: keys containing 'email', 'name', 'date', 'price', 'id', and similar patterns get realistic values matching that field's apparent purpose, not just a random string or number.

Does array length stay the same in generated records?

Each generated record's arrays are sized based on your example array's length (capped at 5 items to keep output reasonable), using the first item's shape as the template for every generated element.

Can I generate multiple records at once?

Yes — use the Records slider (1–20) to generate an array of independently randomized mock objects matching your example's shape.

Why would I use this instead of a schema-based mock generator?

Starting from a real example is often faster than writing a formal JSON Schema — if you already have one sample API response, this tool can immediately produce more variations of it without any schema-authoring step.

Is my example JSON sent anywhere?

No, generation happens entirely in your browser.