Generate a schema from a single JSON example and every field that's present becomes required. The generator can't know that middleName only showed up because this particular person has one. Paste a second sample where middleName is missing and it drops out of required and becomes optional. Required and optional are inferred from what varies across the samples you give it, instead of being guessed from one shape.
// sample 1
{ "id": 1, "name": "Ada", "middleName": "Lovelace" }
// sample 2
{ "id": 2, "name": "Bob" }
↓ (merged schema)
{
"type": "object",
"properties": {
"id": { "type": "number" },
"name": { "type": "string" },
"middleName": { "type": "string" }
},
"required": ["id", "name"]
}Same engine as Live Types, different output format
This tool and Live Types run the same multi-sample inference. Merge several payloads and optionality, nullability, and type unions all come from the variation between them. The output is where they differ. This page renders a plain draft-07 JSON Schema. Live Types renders the same inferred shape as a TypeScript type and a Zod validator, and can save it as a snapshot to diff against later. If you want a type definition and runtime validation rather than a schema document, use Live Types.
What the validator checks, and what it doesn't
The validator supports a practical subset of draft-07: type/integer, properties + required, items, enum, minLength/maxLength, pattern, minimum/maximum, and additionalProperties: false. It does not implement $ref, oneOf/allOf/not, or format keywords like format: "date-time". Full draft-07 conformance means validating against the meta-schema itself, which is a much bigger project than a paste-and-check tool. If you need full spec coverage, use a dedicated library like ajv.
Additional properties are allowed by default
Unless the schema sets additionalProperties: false, fields in the data that aren't listed in properties pass without a warning. That's the default in the JSON Schema spec, and this validator follows it. To catch a typo'd field name (usrename instead of username) as an error instead of an ignored extra property, add additionalProperties: false yourself.