input.json
types.ts
Click Convert to generate TypeScript interfaces.

Related

Guides for TS Types

All guides →

How JSON to TypeScript conversion works

Each JSON object becomes a TypeScript interface. The root object is named Root by default. Nested objects get their own named interface derived from the property key — a key named address produces an Address interface.

Arrays and optional fields

Arrays of objects merge all encountered keys across every element. If a key is absent from some items, it becomes an optional property (key?: Type). Arrays of primitives produce typed signatures like string[] or number[].

When to use this

  • API integration — paste a response body and get instant type definitions to paste into your TypeScript project
  • Prototyping — quickly scaffold interfaces when exploring a new API or dataset before writing any parsing code
  • Code review — verify the shape of a JSON payload matches the interfaces your code expects