JSON to TypeScript

Generate TypeScript types from JSON.

Paste a JSON sample and get TypeScript types inferred from its structure — nested objects and arrays included. Great for quickly typing API responses.

Runs entirely in your browser — nothing is uploaded.

How to use the json to typescript

  1. 1Paste a JSON object or array.
  2. 2Copy the generated TypeScript.
  3. 3Rename Root to fit your codebase.

Frequently asked questions

How are arrays typed?

Array element types are inferred from the first item; empty arrays become unknown[].

Are nested objects named?

Nested objects are inlined as structural types for simplicity — extract them into named interfaces as you like.

Related tools