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.
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.
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.
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.
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.
Draft 2020-12, the current specification. The output includes the matching $schema declaration so validators interpret it correctly.
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.
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.
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.
No. Both schema generation and validation run locally in your browser, so your data and schemas stay private.