Skip to content
hateitall

JSON Schema Generator

Get a working JSON Schema from a real example instead of writing every property by hand.

Processed locallyIn: JSONOut: JSON Schema

Loading tool…

How to use json schema generator

  1. Paste a sample document or an array of sample records.

  2. Choose the schema draft and which keys count as required.

  3. Turn format detection and the unknown keys rule on or off.

  4. Copy the schema or download it as a .schema.json file.

What this tool does

  • Merges every record in an array, so optional keys and mixed types are found.
  • Marks a key required only when every sample has it, or every key, or none.
  • Detects date-time, date, time, email, URI, UUID and IPv4 strings.
  • Tells integers from decimals and lists every type a field takes.

How the result is verified

Your sample is validated against the generated schema before you download it, and any record that would fail is listed.

Frequently asked questions

Which draft should I pick?

Draft 2020-12 is the current version. Pick draft 07 if your validator or framework is older; for the keywords this tool writes, the two are the same apart from the $schema line.

How do I get optional fields right?

Paste an array with several real records. A key missing from any of them is left out of required.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Find JSON syntax errors with the exact line and column

JSON→ ReportLight on device

Beautify or minify JSON with your choice of indentation

JSON→ JSONLight on device

Format, validate, tree view, schema, diff and CSV in one tabbed workspace

JSON · CSV→ JSONModerate on device

Collapsible, searchable tree view that stays fast on large files

JSON→ PathLight on device