JSON to TypeScript
Generate TypeScript interfaces from a JSON example in your browser.
TypeScript output
export interface Root {
name: string;
active: boolean;
tags: (string)[];
profile: RootProfile;
}
export interface RootProfile {
city: string;
}How to use the JSON to TypeScript
Generate TypeScript interfaces from a JSON example in your browser.
Steps
- Paste a JSON example into the input editor.
- Choose the root type name.
- Copy the generated interfaces into your TypeScript project.
Example: An object becomes an interface
{"name":"Ada"} โ export interface Root { name: string; }Limitations
A single JSON sample cannot establish every possible field or optional property in a real API. Review nulls, empty arrays, and field names against the actual schema.