← Tools

JSON to TypeScript

Get accurate TypeScript types from any JSON in one click.

Private: your files never leave your device.

Items of a list are merged into one type: keys missing from some items become optional, and nested objects get their own named types. Nothing you paste is uploaded.

How it works

  1. Choose your files.
  2. Adjust the settings if you like.
  3. Download the result, or send it to another device with BroAllDone.

Frequently asked questions

How do I turn JSON into TypeScript types?

Paste the JSON, for example an API response, and press Make types. You get interfaces for every object, ready to copy or download.

What happens with lists of objects?

All items are merged into one type. A key that's missing from some items becomes optional (key?), and a value that's sometimes a number and sometimes text becomes number | string.

How are nested objects named?

After their key: an "address" object becomes Address, items of "orders" become Order. Objects with the same shape share one type instead of repeating it.

Can I get a Zod schema instead?

Yes. Choose Zod schema to get schemas you can validate data with, plus the TypeScript types inferred from them.

Can I choose type or interface?

Yes, and you can set the name of the main type, export the types or not, and make fields read-only.

Is my JSON uploaded?

No. The types are made in your browser, so your data never leaves your device.

More free tools