JSON Schema Inferrer

Derive a JSON Schema from a sample JSON document.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

JSON Schema Inferrer

How to use this tool

  1. Paste a JSON document. Objects, arrays, strings, numbers, booleans and null are all understood.
  2. Infer. The tool derives a JSON Schema describing the document’s types, object properties and array item shapes.
  3. Copy the schema and refine it by hand for anything the sample cannot show.

Worked example

Paste the sample: {"name": "Ada", "age": 36, "active": true, "tags": ["reading", "cycling"]}. The inferred schema is an object with string property name (example Ada), number property age (example 36), boolean property active (example true), and an array property tags whose items are strings, with all four properties listed as required.

What this tool does not do / Limits

A schema inferred from one sample can only describe what the sample shows: a field that never appears is not in the schema, a field that appears once is marked required even if it is optional in general, and types that vary between samples are not captured. For arrays of objects, only fields present in every item are marked required. Treat the output as a starting draft, not a contract.

Frequently asked questions

Why is a field marked required when I know it is optional?

Because it appeared in every object the tool saw. Feed it an array with an item missing that field and it will drop from the required list.

Does it validate my JSON?

No. It describes the shape of a valid document you provide. Validating other documents against the schema is a separate step.

Related tools