Generators

JSON Schema Generator

Generate draft-07 JSON Schema definitions from sample JSON data with automatic type and format inference.

Run tool

This online tool creates a draft-07 JSON Schema directly from sample JSON data. Paste your raw JSON payload, optionally provide a schema title, and run the generator to infer structural types, nested object hierarchies, and array definitions.

When you supply an object, the generator creates property definitions for each key, marks every present field as required, and disallows unlisted properties. For array values, it inspects list items, combines different shapes using an anyOf structure without duplicates, and keeps empty arrays flexible. Scalar values map directly to standard JSON data types such as integers, numbers, booleans, and nulls.

The generator also recognizes common string patterns and automatically attaches format annotations for email addresses, UUIDs, URIs, IPv4 addresses, dates, times, and combined date-time timestamps. The maximum supported input size is 1,000,000 UTF-8 bytes. Malformed syntax is flagged so you can correct your sample before generating schema specifications.

Instructions

  1. Paste or type your JSON sample data into the Sample Data field.
  2. Optionally enter a custom title for your schema, or leave it blank to use the default title.
  3. Click the run button to generate your schema.
  4. Review and copy the resulting draft-07 JSON Schema definition.

Examples

  • Infer an object schema: enter {"id": 101, "email": "user@example.com", "active": true} with the title "User Record" to generate an object schema with integer, formatted email, and boolean properties.
  • Infer mixed array items: enter [{"name": "Alpha"}, {"name": "Beta", "score": 95}] to produce an array schema where elements match either structure through an anyOf definition.

FAQ

Which JSON Schema specification does this tool produce?

The generator outputs schemas adhering to the JSON Schema draft-07 specification, including the standard draft-07 schema URI identifier.

How are string formats like email or date-time detected?

The generator compares string values against built-in pattern matchers and attaches format annotations for email, uuid, uri, ipv4, date, time, and date-time values when a match is found.

What happens if the input JSON is malformed?

If the input cannot be parsed as valid JSON or is completely empty, the tool flags an error instead of generating an incomplete schema.

How does the generator handle arrays with differing element structures?

When array items have varying structures, duplicate item schemas are removed and the distinct definitions are merged into an anyOf composite array definition.

Embed this tool

Add this working SmartPlusLab tool to your website with the code below.