JSON to TypeScript Interface Generator

Convert JSON to TypeScript interfaces and type aliases instantly. Supports nested objects, arrays, null types, and optional fields with configurable output options.

Input JSON
TypeScript Interfaces

Features

🔷 TypeScript Types

  • Interface and type alias support
  • Nested object interfaces
  • Array type inference
  • Null-aware optional fields

⚙️ Configurable Output

  • Toggle interface vs type
  • Export declarations
  • Readonly modifiers
  • Nested type generation

🎯 Type Accuracy

  • string, number, boolean inference
  • unknown | null for null values
  • Type[] for arrays
  • unknown[] for empty arrays

TypeScript Guide

Interface vs Type

TypeScript interfaces and type aliases are both used to describe object shapes. Interfaces are extensible with declaration merging; type aliases support unions and intersections.

// Interface (extensible)
export interface User {
  id: number;
  name: string;
  active: boolean;
}

// Type alias (flexible)
export type User = {
  id: number;
  name: string;
  active: boolean;
};