JSON to TypeScript

Infer TypeScript interfaces from a JSON object sample.

Converted in this browser. The JSON is not sent anywhere.

Types are inferred from one sample — keys absent from the sample and values null everywhere cannot be detected. Keys that are not valid identifiers are quoted.

How to use

  1. Paste a JSON object.
  2. Generate the interfaces.
  3. Copy the output.

What it supports

Types are inferred from a single sample — keys absent from the sample and values that are null everywhere cannot be detected. Identically-shaped objects share one interface; non-identifier keys are quoted.

Related tools

Related guides