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.
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "age": {
      "type": "integer"
    },
    "active": {
      "type": "boolean"
    },
    "website": {
      "type": "string",
      "format": "uri"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        }
      },
      "required": [
        "street",
        "city",
        "postalCode"
      ]
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "name",
          "year"
        ]
      }
    },
    "lastSeen": {
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "type": "null"
    }
  },
  "required": [
    "id",
    "name",
    "email",
    "age",
    "active",
    "website",
    "tags",
    "address",
    "projects",
    "lastSeen",
    "metadata"
  ]
}
Options

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.