interface Root {
user: User;
}
interface User {
id: number;
name: string;
email: string;
active: boolean;
score: number;
tags: string[];
address: Address;
}
interface Address {
city: string;
zip: string;
}The generator analyzes your JSON structure to infer types — strings, numbers, booleans, arrays, and nested objects each become properly typed interface properties. Arrays of mixed types become union types.
The types are inferred from the sample data you provide. For best results, use a JSON sample that includes all possible fields and representative values. Optional fields (not present in all array items) are marked with ?.
The root interface is named based on the JSON structure. You can copy the output and rename interfaces as needed. For nested objects, sub-interfaces are automatically named based on their parent key.