Private by default

JSON Schema Generator from Sample

Generate object properties, required keys, primitive types, and array item candidates.

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

Infer a deterministic JSON Schema Draft 2020-12 starting point from one valid sample.

Generate object properties, required keys, primitive types, and array item candidates.

Open guide and examples

How to use this tool

  1. Paste JSON, upload a local file, or load a CORS-enabled public URL.
  2. Paste a representative sample and run Generate JSON Schema.
  3. Review the result, then copy it or download it with the correct file type.

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

Does this tool upload my JSON?

No. The transformation runs in your browser. URL import contacts only the address you explicitly enter.

What happens when the JSON is invalid?

The editor marks the likely location and keeps stale output out of the result pane.

What does JSON Schema Generator produce?

It emits a starter Draft 2020-12 schema inferred only from values present in the sample.

What limitation applies to JSON Schema Generator?

One sample cannot reveal optional fields, formats, numeric bounds, string patterns, or business rules; review the schema.