Scans arrays of heterogeneous objects to identify optional properties (field?: type) and union types.
Interface or Type Alias Toggle
Generate export interface or export type declarations based on your codebase conventions.
Download .d.ts or .ts
Copy declarations directly into your frontend or backend project, or download as a definition file.
FAQ
Common questions
How does this tool detect optional fields?
When you provide an array of objects, the generator inspects all objects. If a property appears in some items but not all, it is marked with ? (optional).
Does it handle mixed array types?
Yes! Arrays with mixed elements (e.g. strings and numbers) generate union types such as (string | number)[].
Can I choose between interface and type?
Yes! Use the toggle in the toolbar to switch between "interface" and "type" output.
Can I change the root interface name?
Yes, customize the root interface name (e.g. UserResponse, ApiResponse) in the options input.