๐
JSON to TypeScript
Developer
Infer TypeScript declarations from a JSON sample. Objects become interfaces; arrays and primitive values become type aliases. Mixed arrays retain their observed member types, including null. Review the result against data your sample does not cover.
0
0
Input
Output
Infer TypeScript declarations from a JSON sample. Objects become interfaces; arrays and primitive values become type aliases.
See moreSee less about the JSON to TypeScript
Mixed arrays retain their observed member types, including null. Review the result against data your sample does not cover.
Examples
A mixed list
{"class":true,"items":[1,"two",null]}The class property is boolean; items contains number, string and null. Choose valid, non-reserved root and array-item names. Limits: 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected.
Key features
- Sample-based type inference
- Root and array-item names
- Quote and semicolon options
Related Blog Posts
Quick answers for JSON to TypeScript
What does this tool produce?
Infer TypeScript declarations from a JSON sample. Objects become interfaces; arrays and primitive values become type aliases. Mixed arrays retain their observed member types, including null. Review the result against data your sample does not cover.
What are the limits and important options?
The class property is boolean; items contains number, string and null. Choose valid, non-reserved root and array-item names. Limits: 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected.