JSON to JSON Schema Generator

JSON to JSON Schema Generator generates a JSON Schema from a JSON sample: it infers the types, merges array elements, marks fields present in every sample as required and flags nullable fields. 2020-12, 2019-09 and Draft-07 are supported. Your JSON never leaves your device.

Result
—

How it works

  1. 1Paste a sample JSON into the left box.
  2. 2Choose the schema version and optionally add a title.
  3. 3Copy the generated schema with "Copy" and use it in your validator.

Frequently asked questions

How strict is the generated schema?+

It is based only on the sample you give; constraints such as enum, format or minimum are not added, extend it by hand when needed.

What if some objects in an array lack a field?+

A field missing from any element is left out of the required list.

How are nulls handled?+

Fields seen as both null and a value get a type list such as ["string", "null"].

Embed on your site

Size
480 × 360px
<iframe
  src="https://toolsqube.com/en/code/json-schema-generator/embed"
  width="480" height="360"
  style="border:0;border-radius:14px"
  title="JSON to JSON Schema Generator · ToolsQube"
  loading="lazy">
</iframe>

Want to go deeper on this topic: Developer Tools Guide →

Command Palette

Search for a command to run…