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
- Paste a representative JSON sample into the editor.
- Read the inferred draft-07 schema in the output panel.
- 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
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base32 Encode
Base32 encode and decode text online using the standard RFC 4648 alphabet with proper padding. UTF-8 safe, fast and private in your browser.