JSON to TypeScript
Infer TypeScript interfaces from a sample JSON value, live as you type.
interface Root {
id: number;
name: string;
active: boolean;
tags: string[];
}Infers TypeScript interfaces from a sample JSON value, live as you type — one interface per nested object shape. Since it only sees one sample, it can't know if a field is ever optional or a union of types; review the output before using it. Runs entirely in your browser.
What is JSON to TypeScript?
Paste a sample JSON value (an API response, a config object) and get inferred TypeScript interfaces instantly — one interface per nested object shape, saving the tedium of hand-writing types for a large response. A fast starting point when integrating a new API: paste one real response and get a typed shape to work against immediately, instead of hand-writing an interface field by field. Inference happens live in your browser as you type.
FAQ
They're inferred from one sample, so a field that's sometimes null, sometimes a different type, or sometimes absent won't be reflected — review the output and adjust for optionality/unions your API actually has.
From the shape of their items — an array of objects produces an interface for that object shape plus an array type referencing it; an array of primitives produces a simple primitive array type.