Free online tools

JSON Schema Generator

Paste a representative JSON value or an array of records to draft its shape. Review the editable schema text in your own editor and adjust rules the sample cannot establish.

Enter your values

Paste valid JSON, up to 100,000 UTF-16 units. Use an array to infer shared and optional fields across several example objects.

This tool processes your input in your browser.

Result

Infer nested objects and array items

The schema describes types observed in the sample and merges keys from objects at the same position. When array items contain different value types, it describes the alternatives together. Empty arrays leave item types open. Types are inferred from the browser’s parsed values, with safe whole numbers represented as integers.

Review which properties must be present

The default leaves every property optional. In common-key mode, a property becomes required only if it appears in every observed object at that position. With one object, that includes every observed key. The additional-properties setting controls whether keys absent from the sample are permitted.

Frequently asked questions

Will a sample string become a fixed value or an enum?

The generator infers the string type. Add enumerations, patterns, formats and numeric bounds in your schema editor when your application requires them.

How does the generator handle numbers and null?

A safe whole number produces an integer type, other finite numbers produce number, and null produces its own type. Browser numeric precision applies to the sample, so use strings for long identifiers that must keep every digit.

Can I use the generated schema directly in a validator?

The output targets JSON Schema draft 2020-12. Review required properties, allowed extra keys and constraints with representative valid and invalid data before adopting it.