JSON to TypeScript Interface

Use this page when you want export interface names for every nested object. The converter below starts in interface mode.

JSON to TypeScript converter

Types update as you type. Conversion runs in this browser and is not posted to a conversion API.

TypeScript output
// Generated locally in your browser. No data was sent to a server.

export enum Status {
  Complete = "complete",
  Draft = "draft",
}

export interface Profile {
  email: string;
  score: number;
}

export interface Project {
  title: string;
  status: Status;
}

export interface RootObject {
  id: number;
  name: string;
  active: boolean;
  role: string;
  profile: Profile;
  tags: string[];
  projects: Project[];
}

Why emit interfaces from JSON

Interfaces are the usual choice for object payloads you will extend later. This page locks Output to Interfaces so nested keys such as profile and projects become export interface names instead of inline objects.

The sample on the left includes a nested profile and a projects array so you can see extraction immediately. Rename the root if your resource is User or Invoice.

What this page does not do

It does not convert JSON Schema or Zod. It does not invent fields that are absent from the sample. For type aliases, use the type alias converter instead of this page.

FAQ

How are nested JSON objects named?

Each nested object uses a PascalCase name from its JSON key. Arrays of objects use a singular item name. Identical shapes reuse one interface.

Can a root JSON array still produce interfaces?

Yes. The items become an interface, and the root is a type alias for that interface array, because a TypeScript interface cannot represent a top-level array by itself.

When should I pick type aliases instead?

Use the type alias page if you want export type Name = { ... } for objects, or if you are modeling unions more than extendable object shapes.

Part of JSON to TypeScript Converter. Conversion still runs in the browser on this page.