JSON to TypeScript Interface Generator

Generate TypeScript interfaces from a JSON sample instantly.

interface Root { id: number; name: string; active: boolean; roles: string[]; profile: Profile; } interface Profile { age: number; city: string; }

Nested objects become their own interfaces; arrays are typed from their first item. Paste a representative sample for the best result. Runs in your browser.

Paste a JSON object and get ready-to-use TypeScript interfaces, with nested objects extracted into their own named interfaces and arrays typed from their items. Saves you from hand-typing types for API responses and config files. Everything runs in your browser β€” your JSON is never uploaded.

How to use the JSON to TypeScript

  1. Paste a representative JSON sample.
  2. Optionally rename the root interface.
  3. Copy the generated TypeScript interfaces.

Frequently asked questions

How are nested objects handled?

Each nested object becomes its own named interface, referenced from the parent β€” the idiomatic way to model structured data in TypeScript.

How are arrays typed?

Arrays are typed from their first element, so ["a", "b"] becomes string[]. For arrays of objects, paste a sample whose first item has every field for the most complete type.

Is my JSON sent to a server?

No. Parsing and type generation run entirely in your browser.