EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

JSON to TypeScript

Generate TypeScript interfaces or types from JSON, with nested objects, arrays, optional fields and PascalCase names.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste the JSON to generate the interfaces.

Available in: PortuguêsEspañolEnglish

Advertisement

JSON to TypeScript: what it is for

Paste JSON, like an API response, and the tool generates TypeScript interfaces instantly. Nested objects become separate interfaces with PascalCase names, and lists of objects are fully analyzed to mark optional fields.

Choose between interface and type, with or without export and readonly. Everything runs in your browser.

How to use

  1. Paste the JSON.
  2. Set the root name and the options.
  3. Copy the generated interfaces.

When to use it

  • Typing API responses on the front end.
  • Creating models for Angular, React or Node projects.
  • Documenting a JSON structure.

Frequently asked questions

How are optional fields detected?

When the JSON has a list of objects, fields that don't appear in every item get a question mark (field?: type).

What if a field is null?

It becomes type | null when there's another type in the same field, or just null if it only comes empty. Adjust the type later if you know what it is.

Is it really free?

Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.