JSON to TypeScript Interface Generator
Generate TypeScript interfaces or type aliases from a JSON sample, entirely in your browser.
Generated as RootObject
Ctrl/Cmd+Enter
Generated code appears here
Sample-based inference
Output reflects only the JSON object or non-empty array of objects sample you provide. Missing keys or alternate shapes will not be inferred.
Arrays and unions
Mixed object samples can merge into optional fields or unions. Root arrays must contain objects only.
Optional fields
Properties may become optional when sibling objects differ. Null handling and exact intent still need human review.