Simple flat object
Paste {"id":1,"name":"Ada","active":true} to generate interface Root { id: number; name: string; active: boolean; }, with every type inferred straight from the sample values.
Convert JSON to TypeScript interfaces online, including nested objects — free generator.
About
Reads a sample JSON object and generates a matching TypeScript interface, including a separate named interface for every nested object it finds.
Frontend and full-stack developers use it to quickly scaffold types for an API response without typing them out by hand, especially useful the first time they wire up a new endpoint. It's one of many free developer tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.
Examples
4 worked examples
Paste {"id":1,"name":"Ada","active":true} to generate interface Root { id: number; name: string; active: boolean; }, with every type inferred straight from the sample values.
Paste {"user":{"id":1,"name":"Ada"}} and a separate interface User { id: number; name: string; } is generated, with the root interface referencing User as the property's type.
Paste {"tags":["js","py"]} and the property comes out as tags: string[];, with the type taken from the array's first item.
Paste {"items":[]} and since there's no element to infer a type from, the property comes out as items: any[];.
FAQ
Quick answers to common questions about the JSON to TypeScript Interface Generator.
It infers a TypeScript interface — including any nested interfaces — from a sample JSON object.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. The interface is generated entirely on your own device — nothing you paste is sent to a server.
The tool uses the first object in the array as the sample to infer the interface from.
Each nested object gets its own separate, named interface (named after its key), and the outer interface references that name as the property's type.
Since there's no element to infer a type from, an empty array is typed as any[].
No. Every property from the sample object is generated as required; you may want to mark some as optional by hand if the real data can omit them.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
Did JSON to TypeScript Interface Generator work for you?