Simple object
{"id":1,"name":"Ada","active":true}export interface Root { id: number; name: string; active: boolean; }AppHelp
Paste one JSON object or an array of samples and get editable TypeScript definitions instantly, with optional-key inference, naming controls, copy, and .ts download.
Paste a JSON sample and get editable TypeScript definitions immediately.
export type Root = RootItem[];
export interface RootItem {
id: number;
name: string;
roles: string[];
nickname?: string;
}Types are inferred from the sample values. Review optional, nullable, and empty-array fields before using the output in production.
Paste valid JSON to generate TypeScript interfaces or type aliases immediately. Nested objects become named declarations, arrays are merged across samples, missing keys can become optional, mixed values become unions, and null remains explicit; all processing stays in your browser.
{"id":1,"name":"Ada","active":true}export interface Root { id: number; name: string; active: boolean; }[{"id":1},{"id":2,"nickname":"lin"}]export interface Root { id: number; nickname?: string; }Enable missing-key inference so properties absent from some samples receive ?.
[{"score":9.5},{"score":null}]score: number | null;
Null is preserved rather than silently converted to any.