JSON to TypeScript Types
Generate TypeScript interfaces and type aliases from a JSON sample, including nested objects and array item types. Processing runs locally in your browser.
Input is processed in your browser and is not uploaded. Review converted output before using it in a production project.
How to infer TypeScript types from JSON
- Paste a representative JSON object or array.
- Select Generate TypeScript types.
- Review the inferred Root type.
- Copy or download the TypeScript declaration.
- Add optional fields and domain-specific unions to fit your full dataset.
About this tool
Types are inferred from the supplied sample only. Nulls, heterogeneous arrays and optional properties may need manual refinement. Nested objects and arrays are inferred recursively, but the tool does not generate runtime validators. The JSON sample is parsed locally and is not uploaded.
Frequently asked questions
How does JSON to TypeScript Types work?
Types are inferred from the supplied sample only. Nulls, heterogeneous arrays and optional properties may need manual refinement.
Are input files or data uploaded?
Nested objects and arrays are inferred recursively, but the tool does not generate runtime validators.
Which features or types can be lost?
The JSON sample is parsed locally and is not uploaded.
What input size is practical?
A single sample cannot reveal fields or values that are absent from it.
How do I troubleshoot a failed conversion?
Fix invalid JSON and provide a representative sample with the fields you need.