JSON to Schema
Infer a JSON Schema from a sample with object, array, primitive types, and required-field support.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Input
Output
Generated locally and ready to copy.
Enter data to see the result
What this tool does
- Draft API validation
- Document data structures
Example
Input
{"name":"Ada","age":37,"tags":["dev"]}Output
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"age",
"tags"
],
"additionalProperties": false
}Generate a basic JSON Schema from a sample.
Frequently asked questions
What types are supported?
Objects, arrays, strings, numbers, booleans, and null are supported.
How is required decided?
Fields present in the sample are required by default.
Is data uploaded?
No. Processing happens locally in your browser.
Keywords:JSON 转 Schemajson-to-schemaJSON Schemaschemadeveloper