How to use the JSON Schema Generator
- Paste a sample JSON object, or an array of examples.
- Choose whether every field is required and whether to detect formats.
- Copy the schema and refine it.
What does this tool do?
JSON Schema validates API requests and responses, config files and form data, and powers editor autocompletion. Inferring it from a real example saves typing; with an array of examples, fields that are missing from some items are left optional and number types are widened where needed.
Everything runs in your browser — nothing you paste is uploaded.
Why use it?
- Draft 2020-12.
- Detects common formats.
- Merges multiple examples.
Use cases
- Validate API requests and responses.
- Autocomplete and validation for config files in editors.
- Document the shape of data for a team.
From a sample to a schema
{ "id": 1, "email": "ana@example.com", "tags": ["new"] }
becomes an object schema where id is an integer, email is a string with format email, and tags is an array of strings — all marked required if you choose.
Common mistakes
- Inferring from one example, so optional fields end up required — paste an array of examples.
- Not adding limits like minimum, maxLength or enum after generating.
- Forgetting additionalProperties when unknown fields should be rejected.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
Which draft is used?
JSON Schema draft 2020-12.
What are formats?
Hints such as email, date-time and uri, detected from your values.
Is my JSON uploaded?
No, everything runs in your browser.
Content last updated . See how M2Toolkit works.