Free developer schema tool

Free JSON Schema Generator

A JSON Schema generator turns sample JSON into a validation schema for APIs, docs, tests, and config files. Paste a representative payload, tune required fields, then copy or download a draft 2020-12 schema without uploading data.

Sample JSON

Paste an API payload

Draft 2020-12

Generated schema

object schema with 13 properties and 13 required fields.

Root type

object

Properties

13

Required

13

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Webhook Event",
  "description": "Generated from a sample JSON payload for Webhook Event.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "examples": [
        "evt_1024"
      ]
    },
    "type": {
      "type": "string",
      "examples": [
        "invoice.paid"
      ]
    },
    "livemode": {
      "type": "boolean",
      "examples": [
        false
      ]
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "examples": [
        "2026-06-23T12:35:00Z"
      ]
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "examples": [
            "cus_2048"
          ]
        },
        "email": {
          "type": "string",
          "format": "email",
          "examples": [
            "ada@example.com"
          ]
        },
        "plan": {
          "type": "string",
          "examples": [
            "pro"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "id",
        "email",
        "plan"
      ]
    },
    "amount_due": {
      "type": "integer",
      "examples": [
        4900
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "examples": [
          "billing"
        ]
      },
      "examples": [
        [
          "billing",
          "webhook"
        ]
      ]
    },
    "metadata": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "examples": [
            "api"
          ]
        },
        "attempts": {
          "type": "integer",
          "examples": [
            1
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "source",
        "attempts"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "livemode",
    "created",
    "customer",
    "amount_due",
    "tags",
    "metadata"
  ]
}

Workflow

Turn payloads into validation contracts

Step 1

Paste a JSON sample

Add a representative object, array, webhook payload, API response, or config example.

Step 2

Choose schema options

Set the title, required-field behavior, additionalProperties preference, and example values.

Step 3

Review inferred types

Check nested properties, arrays, string formats, and required fields in the generated schema.

Step 4

Copy or download

Copy the schema or download it as a .schema.json file for validators, docs, and tests.

FAQ

JSON Schema questions

What is a JSON Schema generator?

A JSON Schema generator reads sample JSON and creates a validation schema that documents object properties, data types, required fields, and nested structures.

Does this tool upload my JSON?

No. The schema is generated in your browser, so pasted API payloads are not uploaded to Code Card by this tool.

Which JSON Schema version does it generate?

The output uses JSON Schema draft 2020-12 and includes the $schema field so validators can detect the expected dialect.

Can it infer nested objects and arrays?

Yes. The generator walks nested objects and arrays, merges object keys across array items, and creates nested properties and items schemas.

Should I review the generated schema?

Yes. Generated schemas are a strong starting point, but you should review business rules such as minimum values, enums, patterns, and custom constraints.

Code Card

Share the work behind your code

Code Card turns AI coding activity from Claude Code, Codex, and OpenClaw into public developer profiles with contribution graphs, badges, and usage breakdowns.

Related tools

More developer utilities