Skip to content

← ToolsConverters

JSON to TypeScript.

Infer TypeScript interfaces from JSON, with optional Zod schemas. Interface or type-alias output.

Client-onlyTS · Zod
JSON in117 chars
TypeScript13 lines
export interface RootAddress {
  city: string;
  zip: string;
}

interface Root {
  id: number;
  name: string;
  tags: string[];
  address: RootAddress;
  active: boolean;
  score: number;
}

🔒 Privacy — runs 100% locally

No uploads · no cookies · works offline after load. View Source if you don't believe it.

How to use.

  1. Paste JSON — interfaces infer live.
  2. Toggle interface/type, readonly, or switch to Zod for runtime schemas.
  3. Copy into your codebase (export keyword included).

Related tools.

FAQ.

How are optional fields handled?

Conservatively — every observed key is required. Delete or add ? where your API is actually optional.

Empty arrays?

They infer as unknown[] since there's nothing to learn from — fill in the element type manually.