Tools
Runs locally

JSON to TypeScript

Infer an interface from a JSON sample.

Ctrl+Enter runs. Ctrl+Shift+Backspace clears.

Export and import are available after you sign in. Sign in

Builds TypeScript types from the sample you paste. It describes that sample, not every future payload.

About this tool

Stop writing types for API responses by hand. Paste a sample payload and get TypeScript interfaces that describe it, ready to paste into your project.

How to use it

  1. 01

    Paste a sample JSON payload.

  2. 02

    Review the generated TypeScript types.

  3. 03

    Copy them into your code.

FAQ

Frequently asked questions

Will the types match every response?

They describe the sample you paste. Optional fields or other variants that are missing from the sample will not appear.

Are nested objects supported?

Yes. Nested objects get their own interfaces and arrays get element types.