JSON to TypeScript

Generate TypeScript interfaces or type definitions from JSON data. Paste your JSON and get properly typed TypeScript code instantly. All processing happens in your browser.

Example input:

{
  "id": 1,
  "name": "John Doe",
  "email": "[email protected]",
  "isActive": true,
  "profile": {
    "avatar": "https://example.com/avatar.png",
    "bio": null
  },
  "roles": ["admin", "user"]
}

Options

Root Name
e.g. User, ApiResponse
Interface
Extensible, best for objects
Nullable Optional
null becomes ?
Export
Add export keyword

Features

  • Handles nested objects and arrays
  • Detects primitive types
  • Generates separate interfaces
  • Handles mixed-type arrays
  • Preserves special property names

How to Use

1
Paste JSON data
2
Interfaces generate automatically
3
Customize options as needed
4
Copy the TypeScript code