A simple user object
{ "id": 1, "name": "Ada", "roles": ["admin", "editor"] }interface Root {
id: number;
name: string;
roles: string[];
}Turn a JSON sample into ready-to-use TypeScript interfaces.
The result will appear here.
Was this tool useful?
Typing an API response by hand is tedious and error-prone: one renamed field and the type silently drifts from reality. This tool infers TypeScript interfaces directly from a real JSON example — the fastest way to get a starting point before you refine it by hand.
Nested objects each get their own named interface, arrays are typed from their elements, and two objects that happen to share a property name but have a different shape get distinct interface names rather than being merged incorrectly.
{ "id": 1, "name": "Ada", "roles": ["admin", "editor"] }interface Root {
id: number;
name: string;
roles: string[];
}Pretty-print or minify JSON, with the exact position of any syntax error.
Check whether a document is valid JSON and get the line, column and reason when it is not.
Convert YAML to JSON or JSON to YAML instantly, right in your browser.
Generate C#, Java or Python model classes from a JSON sample.