Youtilities

JSON to TypeScript

Turn any JSON into TypeScript interfaces. Nested types named, optional keys detected.

Runs in your browser. Nothing is uploaded.

Input

Waiting for JSON

TypeScript
TypeScript types appear here.

What this does

Paste an API response or any JSON and get TypeScript interfaces for it. Nested objects become their own named types; arrays of objects are merged into one type.

Optional fields

If a key is missing from some items in an array, it is marked optional with ?. Turn on All optional when the API can leave out anything. A value that is sometimes null gets | null.

Names

Types are named after their keys: users becomes User, address becomes Address. Two objects with the same shape share one type. Change the root name in the box above the output.

All