Developer

JSON to TypeScript

Generate TypeScript interfaces from one or many JSON examples, with optional fields, unions and reused types.

JSON

About this tool

Paste a JSON response, or a list of example records, to generate TypeScript types. Fields missing from some examples become optional, values that vary become unions, and null is kept as its own type.

Nested objects get their own named types, named after their keys, with lists of items named in the singular. Objects with the same fields are written once and reused. Choose interface or type, inline types, readonly, export and array style.

Types inferred from examples describe what the examples contain. Add examples with missing and null values to make them more precise.

esc
  • Opens in its own window, like any app
  • Works without an internet connection
  • Starts instantly from your home screen or dock

Look for the install icon at the right end of your browser’s address bar, or open the browser menu and choose Install Interformat.