Paste one valid JSON value to infer its current shape.
Merge one or multiple samples, then choose a dialect, required-key policy, nullable behavior, whether object schemas accept extra properties, and optional string formats.
Paste one valid JSON value to infer its current shape.
Merge one or multiple samples, then choose a dialect, required-key policy, nullable behavior, whether object schemas accept extra properties, and optional string formats.
JSON Schema generation guide
Paste one valid JSON value, or switch to multiple-sample mode and provide a non-empty JSON array of representative values. VetaTool merges object fields, required-property evidence, array item shapes, nullability, and primitive types locally in your browser, then produces readable JSON Schema output for review. This tool is free to use. No account or payment is required.
Last updated
Objects become schemas with properties based on every observed field. In multiple-sample mode, only fields present in every object sample remain required; optional fields stay in properties without being forced into required. Numbers, strings, booleans, null values, arrays, and nested objects are merged recursively.
Optional string format inference recognizes conservative date-time, date, time, email, absolute URI, and UUID syntax. Values that only resemble those formats remain ordinary strings.
Arrays with one repeated shape use a single items schema. Multiple samples merge array-item observations across every sample, while genuinely different item types use a deduplicated anyOf list so no observed shape is silently discarded.
One payload cannot prove whether a field is optional. Multiple representative samples provide stronger evidence: fields missing from any object sample become optional, observed numeric and null types are merged, and nested object or array variations are combined. Even then, the generated result remains a configurable starting point rather than a complete application contract.
Required, nullable, additional-property, and string-format controls apply recursively to nested object properties and object schemas inside arrays. Single-sample defaults remain unchanged. In multiple-sample mode, required arrays reflect only fields present in every corresponding object sample, while observed type differences are merged conservatively.
Allow null everywhere uses JSON Schema type unions such as ["string", "null"]. Reject extra keys adds additionalProperties: false to every inferred object schema. Format inference adds only supported standard format annotations. These constructs work in dialect-neutral, Draft 7, and Draft 2020-12 output.
Optionally infer standard string formats when values already use complete standard syntax. The generator can add date-time, date, time, email, uri, or uuid to string schemas, while malformed dates, local-looking emails, relative URLs, and descriptive strings stay unformatted.
Format inference describes lexical shape, not business intent. Review every inferred format before using the schema as an API or validation contract.
Dialect-neutral output keeps the conservative shared subset without a $schema declaration. Draft 7 adds http://json-schema.org/draft-07/schema#, while Draft 2020-12 adds https://json-schema.org/draft/2020-12/schema. All three choices use the same required, nullable, and additional-property settings.
Generation runs locally in the browser, so API samples and configuration data are not sent to a schema service.
The generator infers required object properties, an integer identifier, a string name, and homogeneous string array items.
{
"id": 1,
"name": "Ada",
"tags": ["admin", "editor"]
}{
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"tags": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["id", "name", "tags"]
}Common questions
You can keep dialect-neutral output, select Draft 7, or select Draft 2020-12. The explicit options add the corresponding official $schema declaration without changing the inferred sample shape.
In single-sample mode, every observed key is required because one payload provides no evidence that it is optional. In multiple-sample mode, a field is required only when it appears in every corresponding object sample. Change Required properties to None to omit required arrays entirely.
Yes. Required can include all observed keys or none, Nullable can preserve observed null values or allow null for every inferred value, and Additional properties can remain allowed or add additionalProperties: false recursively.
Distinct observed item schemas are deduplicated and placed under items.anyOf. Repeated values with the same inferred shape produce one shared items schema.
Optionally. Set String formats to Infer standard formats to recognize conservative date-time, date, time, email, absolute URI, and UUID syntax. The default keeps every string unformatted, and near matches remain plain strings for review.
No. Parsing, sample merging, and schema inference run locally in your browser.
Debugging a specific JSON issue? Browse JSON troubleshooting.