Free JSON to TypeScript generator

Paste API or config JSON and generate TypeScript interfaces instantly. Nested objects become named interfaces; uneven array objects mark missing keys as optional. Runs entirely in your browser.

Loading…

How to use this tool

  1. 1

    Open JSON to TypeScript

    Generate interfaces from sample API JSON.

  2. 2

    Paste JSON and set root name

    Choose the root type name and whether to export interfaces.

  3. 3

    Copy TypeScript

    Copy the generated types into your project.

Quick facts

Runs locally?Yes — inference runs only in your browser.
Is anything uploaded?No. JSON stays in this tab.
Optional properties?When array objects omit keys, those properties are marked optional.
Pair with JSON formatter?Use the JSON formatter first if your payload is minified on one line.

Top use cases

  1. Infer TypeScript interfaces from JSON, nested types, optional keys, export toggle — local only.
  2. Runs locally?: Yes — inference runs only in your browser.
  3. Is anything uploaded?: No. JSON stays in this tab.
  4. Optional properties?: When array objects omit keys, those properties are marked optional.
  5. Pair with JSON formatter?: Use the JSON formatter first if your payload is minified on one line.

FAQ

Does it emit classes?

No — only interfaces and type aliases, ready to paste into .ts files.

Union types?

Mixed value types in the same field become union types (for example string | number).

Empty arrays?

They infer as unknown[] until you add a sample element.

JSON with null?

null becomes the null literal type in unions where needed.

Strict accuracy?

Output is best-effort from samples — review before production APIs.

Large JSON files?

Very large payloads may slow the tab; split or trim for huge trees.