JSON to TypeScript Converter
interface Root {
id: number;
name: string;
active: boolean;
roles: string[];
profile: Profile;
posts: Post[];
}
interface Profile {
bio: null;
website: string;
}
interface Post {
title: string;
views: number;
pinned?: boolean;
}Turn a JSON sample into TypeScript interfaces
Paste an example API response or config object and get TypeScript interface declarations to drop into a typed client. Nested objects become their own named interfaces, arrays of objects are merged into one element interface where keys missing from some items become optional (key?:), mixed arrays become a union element type, and keys that are not valid identifiers are quoted.
When to use this tool
Use it to scaffold types from a sample payload — paste an API response, fixture, or config object and get interface declarations to type a client, a function argument, or a test fixture.
Privacy and limitations
Conversion runs locally in your browser with JSON.parse, so payloads never leave the page. Types are inferred from one sample: optional keys, union types, and interface names reflect only the values you paste, so review them before committing.