ModernCalcs

API Mock Data Generator

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

[
  {
    "id": "68509647-1c23-461e-aa3b-7fcc6936e797",
    "name": "Quinn Miller",
    "email": "taylor.miller@test.org",
    "age": 59,
    "active": false,
    "signupDate": "2023-11-25T22:52:10.171Z",
    "tags": [
      "sed sit",
      "adipiscing lorem"
    ]
  },
  {
    "id": "ffefac6f-99b6-4807-8cdb-d8321de207e2",
    "name": "Morgan Johnson",
    "email": "avery.brown@test.org",
    "age": 44,
    "active": true,
    "signupDate": "2026-05-09T15:43:17.557Z",
    "tags": [
      "elit sit",
      "amet sit"
    ]
  },
  {
    "id": "d8f8a3b9-a0cb-4f90-8ad8-e7e49a8e8d59",
    "name": "Sam Williams",
    "email": "jordan.garcia@test.org",
    "age": 26,
    "active": true,
    "signupDate": "2023-04-02T18:25:46.756Z",
    "tags": [
      "consectetur sed",
      "ipsum 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.