Boneyard Tools

JSON Schema Generator

Paste a JSON sample and get a draft-07 JSON Schema instantly. It infers types, walks nested objects and arrays, and marks every key as required so you can tighten it from a working baseline.

How to generate a JSON Schema

  1. Paste a representative JSON sample into the editor.
  2. Read the inferred draft-07 schema in the output panel.
  3. Copy the schema or download it as schema.json, then refine it by hand.

Examples

Object with mixed types

{"name":"Ada","age":36,"active":true}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "age": {
      "type": "integer"
    },
    "active": {
      "type": "boolean"
    }
  },
  "required": [
    "name",
    "age",
    "active"
  ],
  "additionalProperties": true
}

Array of numbers

[1, 2, 3]
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": {
    "type": "integer"
  }
}

Frequently asked questions

What is a JSON Schema?

A JSON Schema is a JSON document that describes the shape of other JSON: the allowed types, properties, required keys and structure. Validators use it to check that data matches the contract before you trust it.

Which draft does this generate?

It generates draft-07 and includes the matching $schema declaration at the root. Draft-07 is widely supported by validators such as Ajv, so the output works in most toolchains.

How does it decide which fields are required?

Inference from a single sample cannot know what is optional, so every key present in an object is listed as required. Remove keys from the required array yourself to mark them optional.

How are numbers and arrays handled?

Whole numbers become integer and decimals become number. For an array it inspects the first element and uses that as the schema for items; an empty array gets an open items schema.

How should I refine the generated schema?

Treat it as a starting point. Loosen required, add formats like email or date-time, set additionalProperties to false to lock down objects, and add enums, minimum or maxLength constraints where they apply.

Is my JSON sent to a server?

No. Schema generation runs entirely in your browser, so your sample never leaves your machine.

Related tools