0

JSON to TypeScript Types Online

Convert JSON into TypeScript interfaces, type aliases or a Zod schema live, with real optional-field detection across arrays.

Processing... 0%

Result

This page opens the converter with type alias preselected as the output format — paste a JSON object or array and it prints type Name = { ... }; blocks instead of interfaces, useful when your codebase's style guide favors type over interface.

The inference underneath is identical to the interface mode: nested objects become their own named type, arrays of objects are compared item by item so a field missing from some entries is marked optional, and a field that mixes null with a real value comes out as a union like count: number | null.

Switch to interface syntax or a Zod schema from the same pasted JSON at any time — only the printed syntax changes, the detected shape stays the same.