JSON Schema Generator
Paste sample JSON and get a Draft 7 JSON Schema with types and string formats filled in.
JSON Schema is a JSON format for describing other JSON documents. A schema lists the fields a document can have, their types, and the rules a validator checks them against.
People use it to validate API payloads, forms, and configuration files. Validation libraries exist for JavaScript, Python, Java, Go, and most other languages.
API validation
Write schemas to validate API requests and responses
Documentation
Describe a data format from a sample payload
Type generation
Feed the schema to a tool that generates TypeScript types
Data migration
Check that migrated records keep the same structure
How does the JSON Schema generator work?
Paste your JSON and click 'Generate Schema'. The tool walks the JSON and writes a schema with the type, string format, and required fields it finds.
What JSON Schema version does this generate?
It generates JSON Schema Draft 7, which validation libraries in most languages support.
How does format detection work?
The tool matches each string against patterns for email addresses, URIs, dates, and date-time strings. A match adds the matching 'format' keyword to that property.
What is strict mode?
Strict mode adds 'additionalProperties: false' to objects, so extra fields fail validation, and 'minItems' to non-empty arrays.
Can I include example values in the schema?
Yes. Turn on 'Include Examples' and the tool copies your input values into each property's 'examples' keyword, which helps when the schema doubles as documentation.
Private by default
Schema generation runs in your browser. Your JSON is never sent to a server.
Related tools
JSON Formatter
Format JSON online in your browser. Paste or upload JSON to tidy it with 2 or 4 space indents, find syntax errors, minify it or browse it as a collapsible tree.
JavaScript to JSON
Convert JavaScript object literals to valid JSON
JSON Merge
Merge two JSON objects online with a deep or shallow strategy and choose how arrays combine. Useful for config files and API responses. Free, no signup.