DevToolbox

โ†‘ โ†“ to select ยท Enter to open ยท Esc to close

JSON to TypeScript

Generate TypeScript interfaces from a JSON example in your browser.

TypeScript output

export interface Root {
  name: string;
  active: boolean;
  tags: (string)[];
  profile: RootProfile;
}

export interface RootProfile {
  city: string;
}

How to use the JSON to TypeScript

Generate TypeScript interfaces from a JSON example in your browser.

Steps

  1. Paste a JSON example into the input editor.
  2. Choose the root type name.
  3. Copy the generated interfaces into your TypeScript project.

Example: An object becomes an interface

{"name":"Ada"} โ†’ export interface Root { name: string; }

Limitations

A single JSON sample cannot establish every possible field or optional property in a real API. Review nulls, empty arrays, and field names against the actual schema.