JSON to TypeScript Interface Generator
Paste a JSON sample and generate matching TypeScript interfaces, with nested objects automatically split into their own named types.
More Developer Tools Tools
How to Use JSON to TypeScript Interface Generator
Paste a JSON object or array and the tool infers a TypeScript `interface` declaration that matches its shape. Nested objects become their own named interface, derived from the key they were found under (e.g. an `address` object becomes `interface Address`); arrays become `Type[]`, with a union of element types if the array contains a mix of shapes; primitives map directly to `string`, `number`, or `boolean`, and `null` values become `Type | null`.
About JSON to TypeScript Interface Generator
Details & Tips
Frequently Asked Questions
How are nested objects converted?
How are arrays handled?
Does it detect optional fields?
What happens with a null value?
What if my JSON sample is an array at the top level rather than an object?
What happens if two nested objects would generate the same interface name?
Does it validate that my input is valid JSON first?
How are ISO date strings typed?
What does an empty array generate?
Can I copy the generated interfaces?
Is my JSON sent to a server to generate the types?
Part of These Collections
Also Available As
json to typescript, json to interface, typescript interface generator, generate typescript types from json, json to ts
Explore More Tools
View all toolsFound a Problem?
Let us know if something with JSON to TypeScript Interface Generator isn't working as expected.
Thanks — we'll take a look.