go-supertools
Developer & Data Tools

JSON Schema Generator

Generate a JSON Schema from a sample JSON document.

Runs in your browser Your input never leaves your device.

A schema inferred from one sample describes that sample, not every valid document. Review it: optional fields, value ranges and enums cannot be guessed. Use an array of samples to learn which properties are optional.

Report a problem with this tool

About this tool

Paste a sample JSON document and the tool infers a JSON Schema (draft 2020-12) that describes it: object properties, array item types, integers versus decimals and null. It can mark every property as required, detect string formats such as email, date, date-time, uuid, uri and ipv4, and add example values. If you paste an array of several objects, their schemas are merged: a property is required only if every item has it, and mixed types become a list of types. A schema inferred from examples describes those examples only, so review it for optional fields, number ranges and enums, which cannot be guessed. Everything runs in your browser.

How to use it

  1. Paste a sample JSON document, or an array of several samples.
  2. Choose whether to mark properties required and detect formats.
  3. Review the schema on the right.
  4. Press Copy schema and edit it for rules the sample cannot show.

Common problems

Everything is marked required
The sample cannot tell optional from required. Untick the required option, or paste an array of samples where some lack a field.
A date is not detected as a format
Only ISO 8601 dates and date-times are recognised, and a format is kept only if every sample value agrees.
A number is typed integer but can be decimal
Add a decimal sample, or change the type to number by hand.