Skip to content
Local

Developer

JSON to TypeScript

Turn a JSON sample into TypeScript interfaces or types, with nested objects named for you.

Runs in your browser. Nothing leaves this device.

How to use JSON to TypeScript

  1. 1Paste a JSON sample, such as an API response.
  2. 2Set the root name and choose interface or type.
  3. 3Copy the TypeScript or download it as a .ts file.

Questions

How are arrays of objects handled?

All the objects in an array are merged into one type. A key missing from some of them becomes optional.

What happens with null?

A null value becomes null, or joins the other type seen for that key, like string | null.

Is my JSON sent anywhere?

No. The types are worked out in your browser and nothing is uploaded.

Is it free?

Yes. No account, no watermark and no daily limit.

Esc