Toolora

JSON to TypeScript

Generate TypeScript interfaces from JSON samples.

The JSON to TypeScript tool generates TypeScript interfaces from JSON samples. It infers primitive types, creates nested interfaces for objects, and handles arrays of objects automatically.

How to use

  1. Paste a JSON object or array into the input field.
  2. Set the root interface name and toggle optional fields or export prefixes.
  3. Copy the generated TypeScript definitions.

Frequently asked questions

Which JSON values are supported?

Objects, arrays, strings, numbers, booleans and null are inferred; empty arrays become unknown[].

Can I rename the root interface?

Yes, the root name defaults to Root and can be changed to any valid TypeScript identifier.