JSONDev.in

JSON to TypeScript Interface Converter

Convert JSON objects to TypeScript interfaces or type aliases. Supports nested objects, arrays, and all primitive types.

About this tool

Convert JSON to TypeScript interfaces or type aliases in one click. Nested objects become their own named interfaces and arrays are typed from their items, ready to paste into your project.

Example use case: Paste an API response and generate TypeScript types for your frontend client.

Output:
Root name:

Frequently Asked Questions

How does JSON to TypeScript conversion work?▾
The tool parses your JSON, infers types for each value, and generates TypeScript interface or type alias declarations with proper nesting.
Does it handle nested objects and arrays?▾
Yes. Nested objects become separate interfaces, and arrays get typed as T[] where T is inferred from the array items.
Is my JSON data sent to a server?▾
No. All conversion happens entirely in your browser using JavaScript. Nothing is transmitted.
Should I use an interface or a type alias?▾
Interfaces are the common choice for object shapes like API responses and can be extended or merged. Type aliases are needed for unions and mapped types. For plain JSON data either works, so pick the one your codebase already uses.
How do I generate TypeScript types from an API response?▾
Copy the JSON from your browser's network tab or from a tool like curl or Postman, paste it in, and copy the generated interfaces into a types file. Use a response that includes every field you expect, since fields missing from the sample won't appear in the types.