JSON to TypeScript

Turn an example of your JSON data into a TypeScript type, so your code knows the type of each field.

1 Paste or type your text

2 Your answer

Your answer shows here as you type.

How to use the JSON to TypeScript

  1. Paste an example of your JSON.
  2. The TypeScript type shows straight away.
  3. Copy it into your code.

Frequently asked questions

What is the type called?

It is always called Root. Rename it in your code to suit your project.

What if an array has mixed items?

The type uses the first item only, so check the rest of your data yourself.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.