JSON to TypeScript

Paste JSON and get clean TypeScript interfaces with inferred types

JSON Input

Paste a JSON object or array

TypeScript

Generated interfaces

interface Root {
  id: number;
  name: string;
  active: boolean;
  roles: string[];
  profile: Profile;
  posts: Post[];
}

interface Post {
  title: string;
  likes: number;
}

interface Profile {
  age: number;
  city: string;
}