JSON to TypeScript Interface Generator
Paste a JSON object and get a matching TypeScript interface.
Advertisement
About this tool
Paste in a sample JSON object and get a matching TypeScript interface back, saving you from writing out type definitions by hand for a large or deeply nested API response. Nested objects generate their own named interface. Every item in an array is looked at, not just the first: a key missing from some items becomes optional (key?:), mixed values become a union (string | null), and a top-level array gives type Root = RootItem[]. Keys that aren't valid identifiers, such as first-name, are quoted.