JSON to TypeScript

Paste JSON and get TypeScript interfaces — nested objects become named interfaces, arrays of objects are merged (with optional fields), and mixed types become unions. Everything runs in your browser.

How it works

Each object becomes an interface; nested objects get their own named interfaces; an array of objects is merged into one interface where fields missing from some elements are marked optional (?). Great for turning an API response into types. To explore a large file first, open the JSON viewer.