Free tools, no sign-up — everything runs in your browser.
ToolHub 1000Free online tools

JSON Schema Guide: Turning a Sample Into a Draft Schema

Understand how inferred schemas describe types and required fields, and why they still need review.

What is the JSON Schema Generator?

Paste a JSON sample and this tool builds a schema describing it: objects get their properties and a required list, arrays get an item type from their first element, and values get string, number, boolean or null types. Nested objects are described in place. It is a draft schema for documentation and validation, so review it before relying on it, since a single sample cannot prove which fields are truly required.

How to use it

  1. Paste your JSON sample into the box.
  2. Click Generate Schema.
  3. Copy the schema and adjust required fields and types for your real data.

Worked example

For the sample, the tool produces a schema of type object with properties name (string), age (number), active (boolean) and tags (array of strings), and a required list containing all four fields.

Is an inferred schema a contract?

Not by itself. It describes one sample faithfully, but a contract needs decisions about optional fields, formats and value ranges that a sample cannot make.

Frequently asked questions

Why is every field listed as required?

Because every field in the sample was present. A single sample cannot tell which fields are optional, so review the required list yourself.

What type does an empty array get?

Just array, with no items type, since there is no element to learn from.

Try the JSON Schema Generator free · All guides