</>

WebDevTools

JSON to TypeScript

Parse your JSON object to a typesccript interface

Paste your JSON and generate TypeScript interfaces automatically. Detects types (string, number, array) and patterns like email, URL, UUID and dates. Save time typing API responses.

JSON Payload

Typescript interface

Guide: convert JSON to TypeScript interfaces

Turning JSON into TypeScript types is a common step when integrating REST APIs, webhooks, or config files. Instead of typing every field by hand, paste a real response and get interfaces that mirror nested objects, arrays, and primitives — even when the API grows new fields over time.

WebDevTools runs entirely in your browser: nothing is sent to our servers. That works well for staging samples, test fixtures, or already-sanitized payloads. You can name the root interface, mark optional properties when array items differ, and copy the output straight into your `.ts` files.

Use this tool when bootstrapping a new module, after an API contract change, or when documenting legacy structures. Pair it with the JSON viewer to validate the payload before conversion and cut down on syntax mistakes.

Step by step

  1. Paste valid JSONUse an API response, exported file, or docs example. Fix trailing commas or quotes if the tool reports a parse error.
  2. Set the root interface namePick a domain-friendly name (e.g. `UserResponse` or `WebhookPayload`). Nested objects get derived names automatically.
  3. Tune options if neededEnable optional properties when the same array mixes objects with different keys — common in flexible or partial APIs.
  4. Copy into your projectPaste the generated TypeScript into `types/`, next to your HTTP client, or a shared package. Refine literal types if you need stricter typing.

Frequently asked questions