milotic

JSON → TypeScript / Zod

Paste any JSON value to infer a TypeScript interface tree or a Zod v4 schema. Nested objects become named types, mixed-key sibling objects merge into optional fields, and heterogeneous arrays become unions. Runs locally in your browser.

Input
Paste a JSON value — object, array, or primitive. Mixed-shape sibling objects infer optional fields.

Emit a TypeScript interface tree. Roots become `type` aliases for unions and primitives, `interface` for objects.

TypeScript output
Paste a JSON value above to infer a type.