{ }jsonkit
Format
Validate
Convert
Query
Generate
§

JSON Schema Generator

Infer a JSON Schema from sample data — or validate against one.
Mode
219 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
✓ complete219 B → 797 B0.0 ms

About JSON Schema Generator

The JSON Schema generator infers a JSON Schema (draft 2020-12) from a sample document, and can also validate JSON against a schema you provide. It reads the shape of your data — types, properties, nesting and arrays — and writes a schema that describes it, saving you from authoring one by hand.

Both generating and validating run in your browser, so your sample data and schemas are never uploaded. It is free, instant and needs no account, which makes it safe to use with real API responses.

Use it to bootstrap a contract for an API, seed request-body validation, document a data structure, or check that incoming JSON conforms to an agreed schema before it enters your system.

How it works

Draft 2020-12 output

Generated schemas target JSON Schema draft 2020-12, the current standard, and include the $schema keyword so downstream validators know which dialect to use. Types are inferred as object, array, string, number, integer, boolean or null based on the sample values.

Required-property inference

Every property present in the sample object is inferred as required, since it is the only evidence available from one example. Trim the required array afterward for fields that are genuinely optional — one sample cannot tell the generator which keys may be absent.

Arrays and nested objects

For arrays, the generator inspects the elements and produces an items schema describing their shape; for nested objects it recurses, building properties and required lists at every level so the schema mirrors your structure exactly.

Validate mode

Switch to validate mode to check a JSON document against a schema. The second input holds the schema, and the tool reports whether the data conforms, calling out the properties or types that do not match.

Frequently asked questions

Which JSON Schema version does it generate?

Draft 2020-12, the current specification. The output includes the matching $schema declaration so validators interpret it correctly.

Why are all properties marked required?

The generator only sees one example, so it assumes every key it observed is required. Remove the genuinely optional fields from the required array yourself — a single sample cannot reveal which keys are sometimes missing.

Can one sample capture every case?

No. Provide a representative sample with all fields populated, then refine the schema by hand for optional fields, enums, formats and constraints the example could not express.

How do I validate data against a schema?

Switch to validate mode, put your schema in the second input and your data in the first. The tool reports whether the document conforms and highlights mismatches.

Is my sample data uploaded?

No. Both schema generation and validation run locally in your browser, so your data and schemas stay private.