JSON to TypeScript

Turn any JSON payload into clean TypeScript interfaces or type aliases, generated in your browser.

100% private — everything runs in your browser

How to Use

  1. 1

    Paste a JSON object or array — an API response works well.

  2. 2

    Set the root type name and pick the options you need.

  3. 3

    Click Generate types, then copy the TypeScript output.

Examples

API response

Input

{ "id": 1, "user": { "name": "Ada" } }

Output

interface Root { id: number; user: { name: string }; }

Array of objects

Input

[{ "sku": "A1", "price": 9.5 }]

Output

type Root = { sku: string; price: number }[];

FAQ

How are optional fields handled?

Keys that are missing in some array items become optional with a ? marker.

Can it generate more than one type?

Yes. Nested objects get their own named types, so the output stays readable.

Is my data uploaded?

No. The generator runs entirely in your browser.

Related Tools