About JSON Schema Generator
JSON Schema Generator reads a sample JSON document and writes a draft-07 schema that describes it: the top-level type, an entry for each property, and nested object and array types derived from the values in the sample. The result is a starting point for validating API payloads or for feeding a tool that wants a schema before it will accept your data.
Type inference handles the cases that matter in practice. Objects become property maps, arrays are typed from their first element, and null values are declared as their own type. Output is pretty-printed, so the generated structure is reviewable rather than a single unreadable line.
What it cannot know is everything the sample does not show. Because inference runs on one example, no property is marked as required, there are no format hints for dates or email addresses, no enumerations, and nothing is forbidden. A field that happens to be null in your sample is typed as null, even if it is normally a string. Treat the output as scaffolding to be tightened by hand rather than a finished contract.
How to use JSON Schema Generator
- 1 Paste one representative JSON object into the input.
- 2 Run it to generate the draft-07 schema.
- 3 Add the parts inference cannot know — required properties, formats and enums — before using the schema for validation.
Frequently asked questions
Why are none of my properties marked as required?
Because a single sample cannot show which fields are optional. Every property present in the sample becomes a described property, but the required list is left empty for you to fill in, since only your API contract knows that answer.
How are arrays of mixed content handled?
Only the first element is inspected, so the array is typed from whatever that element was. An array that holds numbers in one position and strings in another will come out as a single type, and you will need to widen it to a union by hand.
What happens if a field is null in my sample?
It is typed as null, which is accurate for that document and probably wrong as a description of the field in general. Replace it with the real type and add null to the accepted types if the field is genuinely nullable.
Which schema version does it emit?
Draft-07, declared with the standard schema identifier at the top of the document. That version is the one most widely supported by validation libraries and editors, which makes the output portable even if newer drafts exist.
Free, online, and private
Free to use
JSON Schema Generator is completely free. There is no account to create, no login, and no hidden charge or usage limit.
Runs online in your browser
It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.
Your data stays private
All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.
How JSON Schema Generator behaves in detail
These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.
| Parameter | Value |
|---|---|
| Dialect | draft-07 — the $schema value is the literal string http://json-schema.org/draft-07/schema# |
| Serialisation | JSON.stringify with 2-space indentation, and the inferred root keywords sit beside $schema |
| Array items | inferred from the first element only; an empty array becomes an empty items object |
| Null values | a null becomes {"type": "null"}, the draft-07 form rather than a union with other types |
| Nested objects | inlined as nested properties — no definitions block and no $ref pointers are emitted |
| Keywords omitted | no required, no format, no additionalProperties and no value constraints such as minimum or pattern |
Compiled from the implementation of this tool and checked against it by itoolnet.
What JSON Schema Generator does not do
Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.
- Every array is described from its first element alone, so [1, "a"] is typed as integer-only, and an empty array yields an empty items object that places no constraint on the contents whatsoever.
- Nothing is ever marked required. The generator emits no required array at all, which means every property it produces is optional by default and the schema accepts an object with all of them missing.
- Only structure is inferred. Since the code reads typeof and nothing else, a date-like string gets no format, numbers get no minimum or maximum, and no pattern or enum is derived — one sample is described as loosely as possible.
Tested and documented by itoolnet, the team that builds and maintains this site.