JSON to TypeScript
TypeScript
Paste JSON to see its TypeScript types.
Paste JSON and get TypeScript interfaces or types - nested objects named, arrays merged, optional keys and unions inferred. Nothing leaves your browser.
Paste an API response, a config file or any JSON sample and get TypeScript declarations you can drop into your code. Every nested object becomes its own named interface, arrays of objects are merged so keys missing from some items become optional and values of different kinds become unions, and objects with the same shape share one declaration. Choose interface or type, export, readonly and how optional keys are written, then copy the code or download a .ts file.