JSON → TypeScript Interface
Paste any JSON and instantly generate TypeScript interface definitions with proper types, nested interfaces, and array support.
TypeScript interfaces appear here
How to convert JSON to TypeScript
Paste your JSON into the input box. The tool recursively analyses every key and value and generates a matching TypeScript interface (or type alias if preferred). Nested objects become named sub-interfaces, arrays are typed as string[], number[], or as an array of a generated interface type.
Supported conversions
String → string, Number → number, Boolean → boolean, Null → null, Array → typed array, Nested object → named interface, Mixed array → union types.
What if my JSON has null values?
Null values are typed as null. Enable Optional properties to also add the ? modifier, signalling that the property may be absent in some responses.
What is the difference between interface and type alias?
Both define the shape of an object. interface supports declaration merging and is preferred for public API shapes. type alias supports unions and intersections and is often preferred for complex composite types. Toggle the "Use type aliases" option to switch between them.
Can it handle large JSON responses?
Yes — the converter runs entirely in the browser and handles arbitrarily deep JSON. Very large responses (thousands of keys) may take a moment to process.