About the JSON to TypeScript
Generate a TypeScript type from a JSON example. Review the inferred shape before using it in your project.
How to use this tool
Paste input or import a text file, select the options that match your data, and run the tool. Review the result before copying, downloading, or transferring it to another local tool.
What this tool will not do
- Types reflect one sample, not every possible response. Missing fields, optional properties, enums, and dates cannot be inferred reliably from one example.
- Empty arrays become unknown[]. Mixed arrays become unions, including separate object shapes when keys differ. Property names are escaped JSON strings.
- This generates a type alias, not a runtime validator. Use JSON Schema validation when you need runtime data checks.
- Nesting is limited to 32 levels; arrays allow at most 30 distinct inferred shapes.