Paste JSON and get clean TypeScript types with unions, optionality, and more.
Options
This tool allows developers to take raw JSON objects—like API responses, configuration files, or mock data— and instantly generate clean, strongly typed TypeScript interfaces. Instead of writing types by hand, you can copy and paste JSON and get ready-to-use definitions.
Suppose your API returns the following JSON:
[ { "id": 1, "status": "open", "user": { "name": "Ada" } }, { "id": 2, "status": "closed", "user": { "name": "Grace", "email": "g@x.dev" } } ]
The tool will generate TypeScript types like:
export interface Root extends Array<RootItem> {} export interface RootItem { id: number status: "open" | "closed" user: User } export interface User { name: string email?: string }
Notice how email becomes optional (email?: string) because it's not present in every object.
Yes, root-level arrays are automatically typed as Array<T> with smart inference for their items.
Nested objects are expanded into their own interfaces. Identical shapes are de-duplicated where possible to avoid repetition.
Absolutely! Just copy or download the output and drop it into your TypeScript project.