Skip to content

Schema Generator

Generate JSON Schema from JSON

Infer a JSON Schema from representative sample data and choose which observed properties are required.

100% In-Browser & PrivateNo uploadsFree forever

Generate a JSON Schema from an example JSON document. The generator infers nested objects, arrays, primitive types, integer versus number, and null values from the sample.

Choose whether observed properties should be marked as required and select JSON Schema draft 2020-12 or Draft 7. Mixed arrays are represented with a type union and merged object properties.

Inference describes only the data you provide. Add representative examples and review the generated schema before relying on it to validate a wider range of data.

Inferred schema for a sample property

"age": {
  "type": "integer"
}

How to generate a JSON Schema

  1. 1Paste or load representative JSON sample data.
  2. 2Choose the JSON Schema draft and whether observed properties should be required.
  3. 3Generate the schema, then review inferred types, nested objects, and array items.
  4. 4Copy or download the schema and adjust it for cases not represented in your sample.

Why MyJSONPal is different

Privacy-first, by design

All parsing, validation and conversion runs in your browser. Your data is never sent, logged, cached or sold — close the tab and it is gone.

Fast, even on huge files

Heavy processing is offloaded to a Web Worker, so multi-megabyte documents are handled without freezing the interface.

No accounts, no limits

There is nothing to sign up for and no usage quota. Paste, format, convert and download as often as you like.

Frequently asked questions

How do I generate JSON Schema from JSON online?

Paste a representative JSON sample, choose Draft 2020-12 or Draft 7 and your required-property preference, then generate and review the inferred schema.

Which JSON Schema drafts can I generate?

The generator supports draft 2020-12 and Draft 7.

How are required properties inferred?

When the option is enabled, properties present in every observed object are marked required. With one example object, all its properties are required.

How are arrays handled?

Array items are inferred together. Mixed primitive types become a type union, and object items combine observed properties; empty arrays allow any item until you provide a non-empty sample.

Does the generated schema perfectly describe my data?

No. It is inferred from the sample only. Add multiple representative cases and review required fields, unions, and constraints before using the schema.

Is my JSON uploaded?

No. Generation runs locally in your browser using a Web Worker.