OrbitTest
Dev Tools Mobile Client

Developer Tools

JSON to JSON Schema Generator

Paste a JSON sample and get a typed JSON Schema in return — types, nested objects, arrays and required fields are inferred automatically. Everything runs in your browser; your data is never uploaded.

JSON input
JSON Schema
 
Paste JSON and click Generate Schema.

From example payloads to a validation contract

Writing a JSON Schema by hand is tedious. This generator gives you a correct starting point in one click: it reads a representative JSON document and produces a schema describing the shape — types, nested structures, arrays and required keys — that you can drop straight into request validation, contract tests, or editor autocompletion.

What it infers

  • Primitive types — string, number, integer, boolean and null.
  • Objects — a full properties map with an optional required list.
  • Arrays — element schemas are merged into a single uniform items schema.
  • Mixed types — values that vary across samples collapse to a type union.
  • Draft choice — emit Draft-07 or 2020-12 with the correct $schema.

Frequently asked questions

How does JSON to JSON Schema inference work?

The tool walks your JSON and infers a type for every value. Objects become "object" schemas with a properties map; by default every key present is marked required. Arrays are inspected and their element schemas are merged so a uniform "items" schema is produced. The result is valid JSON Schema you can refine by hand.

Which JSON Schema drafts are supported?

You can generate Draft-07 or Draft 2020-12. The only practical difference here is the $schema URI emitted at the top; the structural keywords used (type, properties, required, items) are compatible across both drafts.

Why are all properties marked required?

A single sample cannot tell which fields are optional, so the safest inferred contract treats every observed key as required. Turn off "Mark all required" to emit an empty required list, then add back only the fields you know must always be present.

Is my data sent anywhere?

No. Inference happens locally in your browser with JavaScript. Your JSON never leaves your device, so it is safe to use with private API responses.