Generate TypeScript interfaces from JSON
This converter turns a JSON sample into ready-to-use TypeScript interfaces. Paste an API response or any JSON object and it infers the type of every field, creates named interfaces for nested objects, and types arrays by their element shape. Name the root interface whatever you like and copy the result straight into your codebase.
What it handles
- Nested objects become their own named interfaces, referenced by the parent.
- Arrays of objects are merged into a single element interface so you get one clean type.
- Primitives map to string, number, boolean, and null as expected.
Frequently asked questions
How do I convert JSON to a TypeScript interface?
Paste your JSON on the left and the generated interfaces appear on the right, ready to copy. Set the root interface name in the field above.
Does it handle nested objects and arrays?
Yes. Nested objects get their own interfaces and arrays are typed by their contents, including arrays of objects, which are merged into one interface.
What happens with a null value?
A field that is null is typed as null. If the same field appears with a value elsewhere in an array, the tool uses that value's type instead.
Is my JSON uploaded anywhere?
No. Parsing and code generation happen entirely in your browser.