Private by default

JSON Schema Generator from Sample

Infer types, required keys, and array items; then review.

Your data stays in this browser
Input JSONJSON
UTF-8Ln 1, Col 1
ResultJSON-SCHEMA
UTF-8—
Loading…
Browser-only autosaveInputs and settings stay saved only in this browser and return after a reload. Turn on Clear saved data to keep this tool session-only.
Your data stays in this browser
InstantNo server round trips
PrivateBrowser-side processing
AuditableDocumented semantics
PortableCorrectly typed downloads
Category

JSON Schema Generator: How to use this tool

Generate a Draft 2020-12 JSON Schema from sample JSON with inferred types, required keys, and array items.

Infer types, required keys, and array items; then review.

Open guide and examples

How to use this tool

  1. Paste JSON or load a file or public CORS HTTPS URL.
  2. Generate JSON Schema.
  3. Review before copying or validating.

Example to try

Input JSON
{
  "users": [
    {"id": 1, "name": "Ada"},
    {"id": 2, "active": true}
  ],
  "values": [1, "two", null, true],
  "metadata": {
    "createdAt": "2026-08-18T08:00:00Z",
    "page": 1
  }
}
Result
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": "string"
        },
        "page": {
          "type": "integer"
        }
      },
      "required": [
        "createdAt",
        "page"
      ]
    },
    "users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      }
    },
    "values": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "integer"
          },
          {
            "type": "null"
          },
          {
            "type": "string"
          }
        ]
      }
    }
  },
  "required": [
    "metadata",
    "users",
    "values"
  ]
}
Learn

Frequently asked questions

How are required keys chosen?

Object: all keys required. Object array: shared keys only.

How are arrays inferred?

Empty: items: {}. Mixed: anyOf. Integer + decimal: number. Object-array fields merge.

Does it infer application rules?

No. Add formats, ranges, patterns, and business rules.

How do I verify it?

Use JSON Schema Validator on valid and invalid samples (local Draft 2020-12 subset).

Does JSON Schema Generator upload my sample?

Paste and files stay in-browser. URL import makes your browser request the entered public HTTPS address.