Your generated schema will appear here
Enter valid JSON data to get started
Paste a representative JSON sample into the input area and review the generated schema. For the example below, select draft 07 and turn descriptions off so that the complete output stays small. A whole number becomes an integer type. Copy the schema only after comparing its types and required properties with the documents your application actually accepts. One successful sample cannot describe every valid input.
Adjust the required and additional properties options deliberately before generating an object schema. A field present in your sample may still be optional in production. Likewise, inferred string formats and numeric bounds are suggestions to review, not evidence of business requirements. Test the edited schema against both accepted and rejected examples in the validator before using it as an application contract.
Input: 2
Draft: 07; descriptions: off
Output:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "integer"
}
JSON Schema defines the structure and validation rules for JSON data. It's used for API request/response validation, form generation, documentation (OpenAPI/Swagger), database schema enforcement, and config file validation.
The tool generates Draft 7 schemas by default, which is the most widely supported version across libraries and tools. Draft 7 is compatible with ajv (JavaScript), jsonschema (Python), and most API gateway validators.
Use the separate JSON validator to check a document against a schema. This page generates a schema from sample values; generating one is not itself validation. Review inferred types, required fields, additional properties, and formats before using the result. Test representative accepted and rejected documents with the validator version your application actually uses.
The auto-generator marks all fields as required by default. Edit the 'required' array in the generated schema to remove fields that should be optional. This is a common first step after auto-generation.
Absolutely. Copy the schema and use it with OpenAPI/Swagger for API documentation, ajv or joi for runtime validation in Node.js, Pydantic for Python APIs, or any JSON Schema-compatible validation library.