JSON to TypeScript Converter
Paste JSON and instantly generate TypeScript interfaces or types.
How to use the JSON to TypeScript Converter
- Paste any valid JSON object or array into the JSON input box.
- Choose whether you want an
interfaceor atypealias, and whether fields should be optional or readonly. - The matching TypeScript declaration appears automatically a moment after you stop typing.
- Copy the result to your clipboard, or download it directly as a
.tsfile.
Nested objects are converted to inline object types, and arrays of objects have their keys merged so the generated type covers every shape present in the array.
How This Tool Works
The JSON to TypeScript Converter parses the JSON you paste using your browser's built-in JSON.parse, then walks the resulting value to infer a matching TypeScript interface or type — nested objects become inline object types, and arrays of objects have their keys merged so the generated type covers every shape present in the array.
Nothing you paste is ever sent to a server: the entire conversion happens client-side, in your browser's JavaScript engine. You can safely paste real API responses, config files, or any other JSON without worrying about it leaving your machine.