Tool · Free · Browser-only

JSON Schema Generator

Paste any JSON document and get an inferred JSON Schema (draft-07) instantly. Fields present in every array item are marked required; optional fields are detected automatically.


            

How schema inference works

The tool walks your JSON recursively. For each value it assigns a type: string, number, integer, boolean, null, object, or array. For objects, it records all property names and their types. For arrays, it merges the schemas of all items — if all items are objects with the same keys, those keys marked required are only the ones present in every item; keys that appear in only some items are listed as properties but not required.

The result is a starting point, not a definitive contract. You should review it and add constraints (like minLength, enum, format) that the tool can't infer from data alone. To validate a JSON document against a schema, use the JSON Validator.

What the schema covers

  • type — inferred from the actual value
  • properties — all keys found in object samples
  • required — keys present in every sample object
  • items — merged schema of all array elements
  • integer vs number — distinguished correctly

FAQ

What is a JSON Schema?

JSON Schema is a vocabulary for describing the structure and constraints of JSON documents — types, required fields, nested shapes, allowed values. It's used for documentation, validation, and code generation.

How accurate is the generated schema?

The schema is inferred from your sample data, so it reflects what's in the sample. Fields present in every record of an array are marked required; fields that appear in only some records are treated as optional. You should review and refine the output before using it as a contract.

Which JSON Schema draft does this produce?

The output targets JSON Schema draft-07, which is widely supported by validators, editors, and code generators. The $schema URI in the output identifies the version.