Paste sample JSON and get a matching draft-07 JSON Schema, structure inferred automatically
Enter valid JSON on the left to generate a schema.
JSON Schema describes the shape of JSON data, its types, required fields, and nesting, which is useful for API documentation, validation libraries, and editor autocompletion. This tool walks a sample JSON value you paste in recursively, infers a draft-07 schema that would describe it, and shows you the result live.
How to use it:
Tips: for objects, every key present in your sample is marked required, remove that from the output if a field is actually optional in your real data. For arrays, only the first element is used to infer the items schema, so make sure your sample's first array entry is representative.
Since there's no element to infer a type from, an empty array gets an items schema of {} (any type allowed) rather than crashing or guessing.
Yes, the schema is built recursively, so objects nested inside arrays nested inside other objects are all walked and described at every level.
You'll see the exact parse error message (including roughly where it occurred) instead of a crash or a blank result, so you can fix the input and try again.
It's a strong starting point inferred from one example, but it can't know constraints your real data always follows (string formats, minimum/maximum values, enums), review and tighten the generated schema before relying on it for strict validation.