JSON Schema Generator

Infer a schema from a sample document.

Writing a JSON Schema by hand is tedious. Paste a sample document and this generator infers a schema from it: the type of every value, the properties of each object, which properties are required, and the shape of array items.

The result is a starting point. A sample cannot express constraints such as string formats, enums, minimum values or which fields are truly optional, so review the schema and tighten it before relying on it.

How to use it

  1. Paste a representative JSON sample into the left editor.
  2. Review the inferred schema on the right.
  3. Copy it, then test it against real data with the Validate panel.

Questions

How is the required list decided?

Every key of a single object is listed as required. Inside arrays, only keys present in every element are required.

How are numbers typed?

A field is typed integer when every sample value is a whole number, and number otherwise.

Can I use the schema for LLM structured outputs?

Yes. For that use case choose one of the tool definition targets, which produce a strict schema with additionalProperties disabled.

All tools