Emojar – free online tools

JSON to TypeScript

Paste a JSON sample — an API response, a config file, a database record — and get ready-to-use TypeScript interfaces, with nested types, arrays, unions and optional fields inferred automatically.

This tool runs entirely in your browser.

Loading tool…

How to use the JSON to TypeScript

  1. 1Paste a JSON sample.
  2. 2Set the root type name and choose interface or type alias.
  3. 3Copy the generated TypeScript.

What is the JSON to TypeScript?

Each JSON object becomes an interface named after its key (an array called “orders” produces an “Order” interface). When an array contains objects with different keys, the keys that are missing in some items become optional (`?`).

Types can only be as good as the sample: a field that is null in your sample is typed as null. Paste a representative response, then refine the generated types by hand.

Frequently asked questions

Should I use interface or type?

Both work for object shapes. Interfaces can be extended and merged; type aliases can also express unions. Many teams pick one for consistency.

Is the JSON to TypeScript free and private?

Yes. The JSON to TypeScript is free, needs no account, and runs entirely in your browser. What you type is never sent to a server or stored.