JSON to JSON Schema

Generate a JSON Schema from an example JSON object.

Generate a JSON Schema from a sample of your data. Paste an example JSON object and get a draft-07 schema with inferred types (string, integer, number, boolean, array, object) and required fields — ready to use for validation in your API or config. Everything runs in your browser.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "profile": {
      "type": "object",
      "properties": {
        "age": {
          "type": "integer"
        },
        "city": {
          "type": "string"
        }
      },
      "required": [
        "age",
        "city"
      ]
    }
  },
  "required": [
    "id",
    "name",
    "active",
    "tags",
    "profile"
  ]
}

Runs entirely in your browser — nothing is uploaded.

How to use the json to json schema

  1. 1Paste an example JSON object or array.
  2. 2The JSON Schema is generated instantly.
  3. 3Copy the schema into your project.

Frequently asked questions

Which JSON Schema version does it output?

Draft-07, the most widely supported version across validation libraries.

Are all fields marked required?

Yes — from a single example, every present key is treated as required. Edit the generated 'required' array to make fields optional.

Is my data uploaded?

No — the schema is generated entirely in your browser; nothing is sent to a server.

Read the guide
How to Create a JSON Schema (From an Example)

Related tools