JSON to TypeScript
Derive TypeScript interfaces or types from a JSON sample, including nested objects and arrays, with named sub-types instead of one giant inline shape.
Runs in your browser: input and output are never sent to the server, and the platform does not store your input.
Output
Fill in the fields on the left, then run.
How to use
- 1Paste a representative JSON sample.
- 2Set the root type name and style.
- 3Copy the generated types into your project.
FAQ
What if array elements differ?
Element types are merged into a union, for example (string | number)[], and every field that appeared is kept.
How are nested objects handled?
They become named sub-types based on the field name, instead of one unreadable inline shape.
How is null represented?
As T | null by default; tick the option to express it as an optional field with ? instead.
