Format & Convert
JSON to TypeScript
Generate TypeScript interfaces from a sample JSON response, merging array items.
Loading the JSON to TypeScript…
About the JSON to TypeScript
Paste a sample API response and get TypeScript declarations for it. Objects in arrays are merged so every property is covered, properties missing from some items are marked optional, null values become union types, and identical shapes share one interface.
How to use it
- Paste a JSON sample.
- Set the root type name and choose interface or type.
- Copy or download the .ts file.
Frequently asked questions
- How are arrays of objects typed?
- All items are merged into one interface. A property present in only some items is optional (when that option is on).
- Can it generate Zod or JSON Schema?
- Not yet. It generates TypeScript interfaces and type aliases.
- Is my JSON uploaded?
- No. Everything runs in your browser tab with JavaScript. Nothing you enter is uploaded, logged or stored, and the page works offline once loaded.