JSON to TypeScript interfaces

Paste an API response and get ready-to-use TypeScript interfaces - nested objects, arrays and optional types worked out for you.

Root type name

Free · No sign-up · Your files are processed on your device and never uploaded

How to use JSON to TypeScript

  1. Paste or type…
    1

    Paste or type

    Put your content in the box - or try the example.

  2. Result appears instantly
    2

    Watch the result

    The result updates as you type - choose options above if needed.

  3. TXTCopy / Download
    3

    Download the result

    Ready in seconds. Your file never left your device.

Features

  • One interface per object shape, named after its key.
  • Arrays of mixed items become union types.
  • Choose the name of the root type.

Private by design

Everything runs in your browser. Nothing you paste is uploaded, logged or stored - safe for API responses, tokens and customer data.

Questions

Does it detect optional fields?

It types what is in the example. Paste an example with all fields for the most complete interfaces.

More developer tools

All tools →