Output will appear here
Output will appear here
Generate JSON Schema definitions from sample JSON data with our free JSON Schema generator. The tool auto-detects string formats like email, URI, and date-time, marks required fields, and produces draft-07-compliant schemas. Use the output for API documentation in OpenAPI, form validation, or automated configuration file checks.
Try Convert All - paste JSON once, see TypeScript, Go, YAML, and 15 more formats instantly.
Paste a representative JSON object in the input editor. The richer your sample data, the more accurate the generated schema will be.
The output shows a JSON Schema (draft-07) definition with type constraints, required fields, format annotations, and nested object schemas.
Copy the schema or download the .json file. Use it for API documentation (OpenAPI), form validation, or CI pipelines that validate config files.
The generator targets JSON Schema draft-07, which is widely supported by validators like Ajv, Python jsonschema, and OpenAPI 3.0. The output is also forward-compatible with draft 2020-12 for most use cases.
Yes. String values that match common patterns are annotated with a format keyword. Emails get "format": "email", ISO dates get "format": "date-time", and URIs get "format": "uri", among others.
Yes. JSON Schema draft-07 definitions are directly compatible with OpenAPI 3.0 component schemas. You can paste the output into your openapi.yaml under components/schemas with minimal adjustment.
If an array contains elements of different types, the generator produces an items schema using oneOf with each detected type listed. This ensures the schema validates arrays with heterogeneous elements correctly.
By default, nested objects are represented inline within the parent schema for simplicity. For very deep structures you may choose to refactor them into separate definitions manually.