JSON to TypeScript

Generate TypeScript interface definitions from JSON data in your browser.

Infer fields from JSON objects and arrays and generate copyable TypeScript interfaces.

How to use

  1. Paste valid JSON.
  2. Generate the result.
  3. Review inferred types and interface names before copying.

Examples

Object to interface

Input

{"id":1,"name":"demo","enabled":true}

Output

export interface Root {
  id: number;
  name: string;
  enabled: boolean;
}
Privacy
May contact server Avoid sensitive data Uploads only when needed

Your JSON and generated code never leave the current browser.

Frequently asked questions

Yes. Nested objects generate separate interfaces.

The first non-null item determines the array type, so mixed arrays may require manual edits.
Next steps

Related tools

After finishing this task, continue with these related tools.