DevKit
Generator

API Mock Data Generator

Generate realistic mock JSON data from field names for API testing.

Last updated: August 2026

Field names are matched to types: id → UUID, email, name, age, price, date, url, phone, is* → boolean.

Share:

Was this tool helpful?

Generating mock JSON from field names

This generator looks at the field names you provide and produces realistic sample values: a field called email gets a plausible address, createdAt gets a timestamp, price gets a number. It builds an array of such objects so you have a believable payload to feed a frontend or test a client against, instead of hand-typing fake records.

When you reach for it

Useful when the backend is not ready but the UI needs data to render, when writing tests that need a representative response, or when demoing a feature and real data is sensitive. Realistic values catch layout and formatting bugs that uniform placeholders like "test" would hide.

Example

Fields: id, name, email, createdAt

[
  {
    "id": 1,
    "name": "Dewi Lestari",
    "email": "dewi.lestari@example.com",
    "createdAt": "2024-05-18T09:24:00Z"
  },
  { "id": 2, "name": "Budi Santoso", "email": "budi@example.com", "createdAt": "2024-05-19T14:02:00Z" }
]

Common pitfalls

Mock data is only as good as its edge cases. Generators tend to produce tidy, mid-length values, so your UI looks perfect until a real record has an empty name, a 200-character title, or a null field, and the layout breaks. Deliberately include empty strings, very long values, and nulls in your mocks. Another trap is shape drift: if the mock does not match the real API's nesting and types exactly, code written against it fails the moment the real endpoint arrives. Keep the mock schema in sync with the contract, and prefer generating from the same spec both sides share.

FAQ

Will the data be the same each time? Values are random per run unless a seed is used. Seed it when a test needs stable, repeatable output.

Can it match my exact schema? It infers types from field names, so rename ambiguous fields or adjust the output to match nested structures the inference misses.

Is generated data safe to commit? Yes, it is synthetic, but double-check nothing resembles real customer PII before sharing fixtures publicly.