Skip to content
Local

Developer

JSON Schema Generator

Infer a JSON Schema (draft 2020-12) from one or more JSON samples, with types merged and required fields worked out.

Runs in your browser. Files stay on this device.

How to use JSON Schema Generator

  1. 1Paste a JSON sample, an array of samples, or one JSON document per line.
  2. 2Pick whether fields found in every sample are required.
  3. 3Copy or download the schema.

Questions

How are several samples merged?

Every property seen in any sample is listed. A property is marked required only when every sample object has it, and a field that is a number in one sample and null in another gets both types.

When is a field an integer and when a number?

Whole numbers give "integer". If any sample has a decimal there, the field becomes "number", which covers both.

Which formats does it spot?

date-time, date, email, uuid and URI, and only when every string in that field matches the same one. Turn it off if you would rather not have formats.

Is my JSON sent anywhere?

No. The schema is worked out in your browser.

Is it free?

Yes. No account, no watermark and no daily limit.

Esc