MergeJSON

JSON Schema Generator.

Generate a JSON Schema from any JSON sample — pick the draft (2020-12, 2019-09, or draft-07), control required keys, and add examples or an $id. Instant and 100% private, in your browser.

No signup · No uploads · No file-size cap

JSON Schema

// Paste JSON and press “Generate schema”.

Generate JSON Schema online - free and private

A JSON Schema generator creates a validation schema from sample JSON. Paste a realistic object or array above and generate a schema with inferred types, nested properties, array items, required fields, examples, and an optional $id.

Choose the schema draft your validator needs

Different projects use different JSON Schema drafts. This tool supports draft-07, 2019-09, and 2020-12, so you can generate JSON Schema that matches your validator, API docs, or config workflow.

Why use this JSON Schema generator?

It gives you a strong first draft without uploading data. After generation, review required keys and null handling, then use the schema for validation or documentation. Need TypeScript too? Try JSON to TypeScript or read how to generate JSON Schema.

FAQ

JSON Schema, answered.

How do I generate JSON Schema from JSON? +

Paste a representative JSON sample into the JSON Schema Generator, choose your schema draft and required-field options, then generate. The tool infers object properties, arrays, strings, numbers, booleans, nulls, and nested data.

Which JSON Schema drafts are supported? +

The generator supports modern JSON Schema drafts including 2020-12, 2019-09, and draft-07. Choose the draft your validator or API tooling supports.

Can the generator mark required fields? +

Yes. You can control required-field behavior. For strict schemas, mark keys as required. For sample arrays, optional fields can be detected when a key appears in some objects but not others.

Does it infer integer, number, boolean, null, and array types? +

Yes. The tool distinguishes integers from numbers, detects booleans and nulls, creates item schemas for arrays, and builds nested object properties from your JSON sample.

Can I add examples and an $id to the schema? +

Yes. The generator can include examples and an $id so the output is more useful for validators, documentation, API contracts, and schema registries.

Is my JSON sample private? +

Yes. JSON Schema generation runs entirely in your browser. Your sample data is never uploaded or stored, which is important for private API payloads and internal config files.