Skip to content
Toolbento

JSON to TypeScript

Generate TypeScript interfaces from a JSON sample, with nested types and optional fields.

Everything stays on this device

JSON to TypeScript runs in your browser. The text and files you add are worked on by this device and are never uploaded, to us or to anyone else.

  • No uploads. The page is blocked from sending data to any other server.
  • No account, cookies, ads or tracking.
  • Fonts and scripts come from toolbento.app itself, so the page makes no requests to other companies.
  • Closing the tab clears your text and files from memory.

Read the full details on the privacy page.

Missing a feature or found a bug in JSON to TypeScript? Tell me on X (@_andrewtran) or by email.

How to use JSON to TypeScript

  1. Paste a JSON sample in the input pane.
  2. Set the name of the root type if you want one other than Root.
  3. Copy the interfaces or download them as a .ts file.

Questions and answers

Is my data sent anywhere?

No. Everything runs in your browser on this device. Nothing you paste is uploaded or stored.

How are optional fields found?

When a list holds several objects, a key that is missing from some of them is marked optional with a question mark.

What about values that are null?

They are typed as null, because one sample cannot show what else the value may hold. Widen the type by hand where you know more.

Esc

Loading tools