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.
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.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.
Base64 Decode
Decode Base64 to plain text online. Paste a Base64 or base64url string and get instant UTF-8 output. Free, fast and runs in your browser.
Base64 Encode
Encode text to Base64 online. UTF-8 safe, handles emoji and accents, with an optional URL-safe (base64url) mode. Runs in your browser, nothing uploaded.