JSON to TypeScript
Generate TypeScript interfaces from a JSON sample — nested objects and arrays included.
JSON input
TypeScript output
How the generator works
Each nested object becomes its own exported interface, named after its key
(e.g. address → Address). Arrays are typed as
T[] from the union of their element types; mixed arrays fall back to a union type.
The value null adds | null to the property type.
FAQ
Are optional fields detected?
Optionality is inferred per array: if an object key is missing in sibling records of the same array, it is generated as optional (?:).
Is my JSON uploaded?
No. Generation runs entirely in your browser.