JSON to TypeScript
Turn a JSON sample into TypeScript definitions for objects, arrays and mixed values.
Open toolGenerate a Draft 2020-12 JSON Schema from an example document, then refine it to match your data contract.
{
"sku": "P-104",
"quantity": 12,
"warehouses": ["eu-west"]
}
The schema describes an object with a string SKU, an integer quantity and an array of strings. Add any minimum quantity or SKU pattern your application requires.
The generated schema declares Draft 2020-12.
Keep required-field inference off unless your samples represent fields the contract actually requires. Optional fields may appear in a sample.
A sample only shows values and shapes that actually occur in it. Review missing variants, optional fields and business constraints against your application.
Turn a JSON sample into TypeScript definitions for objects, arrays and mixed values.
Open toolCheck JSON syntax and locate parsing errors with clear feedback.
Open toolCompare JSON structures and review added, removed or changed values side by side.
Open tool