JSON Schema generator

Generate JSON Schema from example JSON data

JSON input

Paste example JSON or import a file to infer a starting schema.

Generated schema

Review the generated schema, then copy or download it for further refinement.

Options

Schema draft

What is JSON Schema?

JSON Schema is a standard way to describe the shape of JSON data. It lets you express field types, nested structures, required keys, and validation-friendly constraints in a machine-readable format.

What this generator does

Paste sample JSON and the tool infers an initial schema for objects, arrays, numbers, booleans, null values, and common string formats. The result is a draft you can copy, download, and refine.

Example

For example, given this sample payload:

Example input

{
  "id": "bk-101",
  "title": "In-browser Tools",
  "price": 19.99,
  "tags": ["json", "schema"],
  "published": true
}

Generated schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "title": { "type": "string" },
    "price": { "type": "number" },
    "tags": {
      "type": "array",
      "items": { "type": "string" }
    },
    "published": { "type": "boolean" }
  },
  "required": ["id", "title", "price", "tags", "published"]
}

Tips

  • Use representative sample data, especially inside arrays, so optional fields are easier to infer.
  • Disable “Infer required properties” if your input is only a partial example.
  • Disable “Allow additional properties” when you want a stricter schema by default.
  • Keep string-format detection enabled to infer email, URI, UUID, and date-time values.

How to use

Paste or import JSON, choose options and run. Large input previews are bounded; copying and downloading preserve complete output