Root Name
Keyword
Sample JSON
JSON Input
TypeScript Interface
export interface UserProfile { bio: string; location: string; website: string; } export interface UserTags { id: number; name: string; } export interface User { id: number; name: string; email: string; age: number; active: boolean; avatarUrl: string; createdAt: string; profile: UserProfile; roles: string[]; tags: UserTags[]; metadata: null; }
Zod Schema
import { z } from 'zod'; export const UserProfileSchema = z.object({ bio: z.string(), location: z.string(), website: z.string().url(), }); export type UserProfile = z.infer<typeof UserProfileSchema>; export const UserTagsSchema = z.object({ id: z.number().int(), name: z.string(), }); export type UserTags = z.infer<typeof UserTagsSchema>; export const UserSchema = z.object({ id: z.number().int(), name: z.string(), email: z.string().email(), age: z.number().int(), active: z.boolean(), avatarUrl: z.string().url(), createdAt: z.string().datetime(), profile: UserProfileSchema, roles: z.array(z.string()), tags: z.array(UserTagsSchema), metadata: z.null(), }); export type User = z.infer<typeof UserSchema>;
โœ“
Nested objects
Each nested object โ†’ named interface
โœ“
Array merging
Object arrays merge keys, marks optional
โœ“
Null handling
null โ†’ type | null + .nullable()
โœ“
Smart strings
Detects email, URL, UUID, datetime

JSON to TypeScript + Zod Generator

Paste any JSON and instantly get TypeScript interfaces and Zod validation schemas. Handles nested objects, arrays, nullable fields, and mixed types. Smart inference detects optional fields and union types. Copy the generated code directly into your project.

Output formats

  • TypeScript interfaces with proper nesting
  • Zod schemas with runtime validation
  • Support for arrays, nullables, and optional fields
  • Handles deeply nested JSON structures