DevTools

JSON → TypeScript Generator

Paste JSON and instantly generate typed TypeScript interfaces. Handles nesting, arrays, and optional fields.

JSON Input

TypeScript Output

TypeScript interfaces will appear here

JSON to TypeScript Interface Generator

Paste any valid JSON object or array and instantly get a set of typed TypeScript interfaces. The generator handles nested objects, arrays of primitives, arrays of objects, null values, and mixed-type arrays. Rename the root interface using the toolbar. Download the result as a .ts file. All processing happens locally — no data leaves your browser.

Frequently Asked Questions

How does the generator handle nested objects?
Each nested object becomes its own named interface, derived from the property key in PascalCase. The parent interface references the child interface by name.
How are arrays typed?
Arrays are typed based on their elements. A string array becomes string[], an object array generates a separate interface for the element type (e.g. ItemItem[]).
What happens with mixed-type arrays?
If an array contains elements of different types, the generator creates a union type, e.g. (string | number)[].
Is my JSON data sent anywhere?
No. All TypeScript generation is done in your browser using pure JavaScript. Nothing is transmitted to any server.
Can I change the root interface name?
Yes. Use the Root name field in the toolbar to set a custom name for the top-level interface.