mtools.lol

JSON to TypeScript

Generate TypeScript interfaces from a JSON sample.

How it works

  1. 1Paste a JSON sample.
  2. 2Name the root type.
  3. 3Copy or download the interfaces.

Features

  • Nested objects become named interfaces.
  • Keys missing from some array items become optional.
  • Mixed arrays become union types.
  • Private: runs in your browser; nothing is uploaded.

Frequently asked questions

Why is a field typed as null?

The sample only has null there. Paste a sample with a real value to get its type.