JSON to TypeScript Types

Runs in browser

Generate TypeScript interfaces and types from JSON instantly.

Convert JSON objects to TypeScript interfaces and types instantly. Free online JSON to TypeScript generator — no sign-up required.

JSON to TypeScript Types tool

Files never leave your browser.

Drag and drop a file here, or tap to select

export interface Root {
  "id": number;
  "meta": {
    "active": boolean;
  };
  "name": string;
  "tags": string[];
}

🔒 Runs in your browser · No uploads · Your data never leaves your device

How to use

  1. Paste JSON

    Paste a JSON object or array into the input.

  2. Review generated types

    The TypeScript interface updates automatically as you type.

  3. Copy the output

    Use Copy types to copy the generated interface into your project.

Common use cases

  • Generating types from API responsesPaste a real API response to instantly generate TypeScript interfaces for type-safe consumption in a frontend app.
  • Bootstrapping type definitionsGenerate initial TypeScript types from JSON config files or data schemas to speed up development.
  • Understanding third-party API shapesConvert undocumented API JSON to TypeScript interfaces to understand the data structure before writing integration code.

Examples

  • Nested object

    Infer nested types and arrays.

    Input
    {"id":1,"user":{"name":"A"},"tags":["x"]}
    Output
    export interface Root { ... }

Frequently asked questions

Is this conversion done on a server?
No. Type generation runs entirely in your browser.
Does it handle arrays of objects?
Yes. It infers array element types and merges object keys across items when possible.

Key concepts

TypeScript interface
A TypeScript construct that defines the shape of an object, specifying property names and their types.
Type inference
The process of automatically determining types from values — used here to map JSON values to TypeScript primitives.

You might find these useful too.

More json tools