JSON Mock Data Generator

Generate realistic mock JSON data from a schema or example with configurable seed

Enter a JSON Schema (with "type" and "properties") or a JSON example to infer types from

Same seed produces identical output for reproducible results

Number of items to generate (produces an array when greater than 1)

What is the JSON Mock Data Generator?

The JSON Mock Data Generator creates realistic mock JSON data from a JSON Schema or a JSON example. It infers field types and generates contextually appropriate values — emails for email fields, UUIDs for ID fields, dates for timestamp fields — all with a configurable seed for reproducible output. All processing happens in your browser, so your schemas and data never leave your device.

How to Use

  1. Paste a JSON Schema (with "type" and "properties") or a plain JSON example
  2. Optionally adjust the seed for reproducible results
  3. Set the count if you want to generate multiple records
  4. Click "Generate Mock Data" or wait for automatic processing
  5. Copy the generated JSON for use in tests, prototypes, or documentation

Example: Generating from a Schema

Given this JSON Schema:

{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "name": { "type": "string" },
    "email": { "type": "string", "format": "email" },
    "createdAt": { "type": "string", "format": "date-time" },
    "age": { "type": "integer", "minimum": 0, "maximum": 120 },
    "active": { "type": "boolean" }
  }
}

The generator produces realistic mock data like:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Alice Johnson",
  "email": "alice@example.com",
  "createdAt": "2024-01-15T10:30:00Z",
  "age": 472,
  "active": true
}

Example: Generating from an Example

If you provide a plain JSON object (without schema keywords like "type" or "properties"), the generator infers types from the values and key names. Email-like values produce new emails, UUID-like values produce new UUIDs, and date strings produce new dates.

Reproducible Output with Seeds

The seed option controls the pseudo-random number generator. Using the same seed with the same input always produces identical mock data. This is useful for:

  • Writing deterministic tests that depend on specific values
  • Generating consistent documentation examples across builds
  • Comparing output before and after schema changes
  • Sharing reproducible test data with teammates

Supported Schema Features

  • Types — string, number, integer, boolean, object, array, null
  • String formats — email, uuid, date, date-time, uri, ipv4, ipv6, hostname
  • Enums — picks a random valid value from the enum list
  • Arrays — generates items respecting minItems/maxItems constraints
  • Nested objects — recursively generates properties up to 10 levels deep
  • $ref references — resolves #/definitions/ and #/$defs/ paths
  • Composition — supports allOf (merge), oneOf/anyOf (pick first)
  • Constraints — minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength, maxLength
  • Examples and defaults — uses schema example or default values when provided

Use Cases

  • API testing — Generate request/response payloads for test suites
  • Frontend prototyping — Create mock data before the backend is ready
  • Database seeding — Generate initial data for development environments
  • Documentation — Produce example payloads for API docs
  • Contract testing — Validate consumers handle all response shapes

Privacy and Security

All mock data generation happens entirely in your browser using JavaScript. Your JSON schemas and examples — which may contain proprietary data models — never leave your device. No data is stored, logged, or transmitted.

Frequently Asked Questions

What does the JSON Mock Data Generator do?

It takes a JSON Schema or a JSON example as input and generates realistic mock data. If you provide a JSON Schema, it generates data conforming to the schema types and constraints. If you provide a plain JSON example, it infers types from the values and produces similar data with different realistic values.

What is the difference between providing a schema vs an example?

A JSON Schema explicitly defines types, formats, and constraints (like minLength, maximum, enum). The generator follows these precisely. A JSON example has no explicit type definitions, so the generator infers types from values — detecting patterns like emails, UUIDs, dates, and URLs from the example content and key names.

What is the seed option and why would I use it?

The seed is a number that controls the random data generation. Using the same seed with the same input always produces identical mock data. This is useful for reproducible tests, consistent documentation examples, or comparing outputs between different sessions.

What JSON Schema formats are supported?

The generator supports these string formats: email, uri/url, uuid, date, date-time, ipv4, ipv6, hostname, and phone. It also respects type constraints like minimum, maximum, minLength, maxLength, minItems, maxItems, and enum values.

Can I generate multiple records at once?

Yes. Use the Count option to specify how many items to generate. Setting count to 5, for example, produces an array of 5 objects following your schema or example structure. This is useful for generating test datasets or seeding development databases.

Is my data sent to any server?

No. All processing happens entirely in your browser using JavaScript. Your JSON schemas and examples never leave your device. No data is stored, logged, or transmitted to any server.

How does it handle nested objects and arrays?

Nested objects are generated recursively up to 10 levels deep. Arrays generate items based on the items schema (for JSON Schema) or use the first array element as a template (for examples). A configurable array item count controls how many items are generated per array.

What happens with $ref references in JSON Schema?

The generator resolves $ref references from #/definitions/ and #/$defs/ paths within the same document. Referenced schemas are resolved recursively with depth protection against circular references.