Code Flick TechnologiesToolscodeftech.com

JSON → TypeScript

Paste a JSON sample, get TypeScript interfaces inferred from its structure. Optional union of all values' types per field.

100% in your browser. Files never uploaded.
TypeScript
export interface Root {
  id: number;
  name: string;
  tags: string[];
  address: Address;
}

export interface Address {
  city: string;
  country: string;
}

How to use

  1. 1
    Paste JSON
    A representative sample, ideally with all the optional fields populated.
  2. 2
    Set the root type name
    Defaults to "Root".
  3. 3
    Copy the interfaces
    Drop straight into your codebase.

FAQ

How are nested objects named?
PascalCase of the parent key. An array key is singularized: "users" → User. If two objects collide on a name, the second gets a numeric suffix.
Are array element types unioned?
Yes. ["a", 1] becomes Array<string | number>. Heterogeneous arrays don't silently lose info.

Related tools