D
Devault

JSON to TypeScript

Generate TypeScript interfaces and types from JSON — 100% local processing

JSON Input
TypeScript Output

About JSON to TypeScript

When you consume an API you often have a sample JSON response and need TypeScript types for it. Writing interfaces by hand is repetitive and error-prone for deeply nested data.

Paste a JSON sample and this tool generates TypeScript interfaces that describe its structure, including nested objects and arrays. The output is inferred from the single sample you provide, so treat it as a draft: fields that are sometimes missing or null in real responses may need to be marked optional or widened by hand.

Common use cases

  • Creating types for a third-party API response.
  • Bootstrapping interfaces for configuration files.
  • Documenting the shape of a payload in a pull request.
  • Replacing untyped any values with concrete interfaces.

Frequently asked questions

Are the generated types always correct?
They match the sample you pasted. If real data varies, add optional properties or union types yourself.
How are arrays typed?
Arrays are typed from their elements. Mixed arrays may produce union types, so check the result.
Does my JSON leave the browser?
No. The types are generated locally.