Skip to content
Convertto

Sample JSON Generator — From a JSON Schema

Turn a JSON Schema into realistic sample documents, respecting types, enums, formats and constraints.

To generate sample JSON from a schema, paste a JSON Schema and the generator walks it to build documents that satisfy every constraint — the declared types, enum values, string formats such as email or date-time, numeric minimums and maximums, array lengths and nested objects, including local $ref pointers.

Runs in your browser
Schema support
type, properties, items, required, enum, const, format, minimum/maximum, minLength/maxLength, minItems/maxItems, oneOf, anyOf, allOf and local $ref
Formats honoured
email, uri, uuid, hostname, ipv4, ipv6, date, time, date-time and duration
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Which JSON Schema drafts are supported?

The keywords shared by draft-07 and 2020-12, which covers almost every schema in practice. Both $defs and definitions resolve for local $ref pointers; remote references are not fetched.

Why turn off optional properties?

Because real API clients receive documents where optional fields are missing. Turning the option off randomly omits anything not listed in "required", which is how you find code that assumes a field is always present.

Can I use an OpenAPI schema?

Yes, if you paste the schema object itself rather than the whole OpenAPI document — the component schemas under components/schemas are ordinary JSON Schema.

How to use the sample json generator

  1. 1Enter or paste your json schema.
  2. 2Set the documents.
  3. 3Set the items per array.
  4. 4Set the maximum nesting depth.
  5. 5Turn "Always include optional properties" on or off as needed.
  6. 6Enter or paste your wrap in a key.
  7. 7Turn "Pretty-print" on or off as needed.
  8. 8Enter or paste your seed.
  9. 9The result appears immediately — copy or download it.

Embed this tool

Put the working sample json generator on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More samples & mock data