About JSON Schema
JSON Schema is a declarative language for validating the structure and content of JSON data. It acts as a contract that defines what shape valid JSON must take — which fields exist, what types they hold, which are required, and what additional constraints apply.
What Does This Tool Do?
The JSON to JSON Schema Converter analyses your JSON input and automatically infers a schema that describes it. Paste any JSON object or array and instantly get a valid schema you can use for documentation, validation, or code generation.
Schema Options
- Schema Title: Adds a human-readable title to the root schema object. Useful when the schema will be referenced by name in other schemas or tooling.
- JSON Schema Draft: Controls the
$schemaURI written into the output. Choose Draft-07 for maximum tool compatibility, or 2019-09 / 2020-12 for newer features like$defsandunevaluatedProperties. - Include required fields: When enabled, every key present in a JSON object is added to the schema's
requiredarray, meaning validators will reject objects that omit those keys. - Allow additional properties: When disabled (default),
additionalProperties: falseis added so validators reject any key not listed inproperties. Enable this if the JSON objects in your system can carry arbitrary extra fields. - Infer string formats: Attempts to detect well-known string formats —
date-time,date,time,uuid,uri,email, andipv4— and annotates the schema property with aformatkeyword.
Common Use Cases
- API validation: Validate request and response bodies in REST or GraphQL APIs using validators like Ajv, Zod, or FastAPI.
- Code generation: Feed the schema into tools like quicktype or json-schema-to-typescript to generate typed models in TypeScript, Python, Go, and more.
- Documentation: Attach a JSON Schema to your OpenAPI specification to describe request payloads and response shapes clearly.
- Configuration validation: Use the schema with editors like VS Code to provide auto-complete and inline validation for JSON config files.
- Data pipeline contracts: Define the expected shape of data flowing between services or ETL pipeline stages.
How Types Are Inferred
- JSON
null→{ "type": "null" } - JSON booleans →
{ "type": "boolean" } - Whole numbers →
{ "type": "integer" }, decimals →{ "type": "number" } - Strings →
{ "type": "string" }with optionalformat - Arrays →
{ "type": "array", "items": {...} }whereitemsis derived from all elements - Objects →
{ "type": "object", "properties": {...} }with optionalrequiredandadditionalProperties