Skip to content

JSON Schema Example Generator

Generate a valid example JSON payload from a JSON Schema, honoring types, enums, required fields, formats, bounds and local $ref references.

JSON Schema Example Generator

Generated example
{
  "id": 1,
  "name": "string",
  "email": "user@example.com",
  "role": "admin",
  "active": true,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "tags": [
    "string",
    "string"
  ],
  "address": {
    "street": "string",
    "city": "string",
    "country": "DE"
  }
}

Example generated

What it honors

  • type — object, array, string, number, integer, boolean, null
  • required + properties generated in order
  • enum / const / default picked deterministically
  • format — email, date-time, uri, uuid, ipv4/6, and more
  • minimum / minLength / minItems constraints
  • $ref to local #/$defs or #/definitions

Updated . Provided as is. Check the output before you rely on it in production.

How to use JSON Schema Example Generator

  1. 1

    Paste your JSON Schema

    Drop a JSON Schema into the input, or press Load Sample to start from a worked example with required fields, an enum, a format, and a $ref.

  2. 2

    Decide how defaults are used

    Keep the toggle on to prefer a property's default or examples value when present, or turn it off to derive every value purely from the type and constraints.

  3. 3

    Read the generated example

    The right panel updates live with a formatted JSON payload. Invalid schema JSON surfaces an inline error instead of a broken result.

  4. 4

    Copy it into your fixtures

    Use Copy to grab the example for a test fixture, mock server response, API documentation sample, or request body scaffold.

Questions and answers

What does the JSON Schema Example Generator do?
A JSON Schema describes the shape of valid JSON: types, required properties, enums, formats and bounds. This generator walks a schema recursively and builds a matching example, using const, default, examples or the first enum value where given and otherwise a type- and format-correct value, resolving local $ref.
How are individual values chosen?
Deterministically: const wins, then default or examples when the toggle is on, then the first enum value. Otherwise a value is derived from type, format (email, date-time, uri, uuid, ipv4), and minimum, minLength, or minItems constraints.
Does it resolve $ref, $defs, and definitions?
Yes, for local references such as #/$defs/Address or #/definitions/Item. Remote URL references are not fetched, and reference cycles are detected and stopped so generation never hangs.
Which JSON Schema version is supported?
A practical draft 2020-12 subset covering type, properties, required, enum, const, default, format, oneOf, anyOf, allOf, items, and the common numeric and string bounds. Validation-only keywords like pattern are skipped.
Is my schema uploaded anywhere?
No. Parsing and generation run entirely in your browser with plain JavaScript, so the schema and the example it produces never leave your machine.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/json-schema-example-generator/

For automation planning, fetch the canonical contract at /api/tool/json-schema-example-generator.json.