Tools for converting between various data formats
Automatically converts JSON data structures to TypeScript interfaces or types.
Useful for defining API response types or generating types for config files.
Auto type inference (string, number, boolean, null)
Nested object separation
Array type handling
null → optional property conversion
Set a meaningful root interface name
Enable export option for API responses
Use readonly option for immutable data
A tool that automatically generates TypeScript interfaces or type aliases by analyzing JSON data structures. Paste JSON data from API responses or configuration files to generate ready-to-use TypeScript type definitions with automatic nested object handling and type inference.
Enter JSON
Enter the JSON data in the left editor or load sample data.
Set the Options
Set the root interface name, output format (interface/type), export, readonly, and null-handling options.
Review the Result
The converted TypeScript code appears in the right editor in real time.
Copy or Download
Use Copy to copy the result to your clipboard, or Download to save it as a .ts file.
An interface can be extended and supports declaration merging, making it suitable for library type definitions. A type supports more flexible combinations such as unions and intersections. Interfaces are common for API response shapes, while types are often used for utility types.
The tool analyzes the element types and creates a union type. For example, [1, 'hello'] becomes (number | string)[].
Enable 'null → optional property' to convert fields with null values into optional properties (?). When the option is disabled, the null type is preserved.
Nested objects are automatically separated into their own interfaces or types. For example, an object in an address field generates a separate Address interface.