JSON input
Paste JSON, optionally name the root type, then generate.
Your TypeScript type code will appear here.
Convert JSON into idiomatic TypeScript type aliases. Nested objects become named types, arrays get element types, and missing keys become optional.
Paste JSON, optionally name the root type, then generate.
Your TypeScript type code will appear here.
The generator inspects your JSON and builds a type alias for the root plus one for every nested object. Arrays are typed by their elements, primitives map to string, number, and boolean, and inconsistent keys across array items become optional properties.
Hand writing types for a large API response is slow and error prone. Generating from a real payload captures every field, including ones buried three levels deep, and you can paste the result straight into a .ts file.