Skip to content
Toolwright

JSON Schema Generator

JSON Schema Generator builds a JSON Schema from a sample JSON document, describing its types, nesting and required keys. When the sample is a list, the items are merged so keys missing from some of them become optional. It runs in your browser.

Tool 058 · Developer
Outside requests …How to checkRuns on this deviceWorks offline once opened

How to use JSON Schema Generator

  1. Paste a sample of your JSON. A list with several items gives better results than a single object.
  2. Choose the schema version and which extras to add.
  3. Copy or download the schema, then review it before using it to validate data.

Frequently asked questions

How good is a schema generated from one example?

It is a starting point. A schema can only describe what the sample shows, so it cannot know about value ranges, enums or keys that never appeared. Use several varied samples and edit the result.

How are optional keys decided?

When the sample is a list of objects, a key is marked required only if it appears in every item. For a single object, all of its keys are marked required unless you turn that option off.

Is my JSON uploaded anywhere?

No. The schema is generated in your browser.

Next step

Prefer types in code? Generate TypeScript interfaces from the same JSON. Open JSON to TypeScript.

  1. 060

    JSON to TypeScript

  2. 056

    JSON Formatter & Validator

  3. 061

    JSON to YAML Converter

  4. 055

    JSON Diff