Skip to content
Developer Tools

JSON to TypeScript Generator

Generate a reviewable TypeScript type from valid JSON locally, preserving mixed array values as visible union types.

Local type generation. JSON is parsed and turned into TypeScript in this browser tab. It is not uploaded, fetched, or stored by this tool.

0 / 200,000 characters

Review inferred types. The tool maps only JSON values. Empty arrays become unknown[]; mixed arrays become visible union types. It does not guess optional fields, dates, enums, or application-specific models.

Data handling

Storage and export controls

Retention
The tool's working state is kept only while this page is open. Inputs and results are not saved to persistent storage by Got A Tool.
Export
The tool may prepare a result after you run it. It downloads or copies it only when you choose that action.

Advertising and analytics are separate site services. We do not send selected tool input to them. Read the Privacy Policy for details.

How it works

Create a starting TypeScript type from real JSON values

01

Paste valid JSON

Use representative values from the API response or configuration you are reviewing.

02

Name the root type

Choose the exported type name you want in your codebase.

03

Review unions

Check mixed arrays, empty arrays, and quoted property names before copying the result.

Clear limit

Values are evidence, not a full schema.

A single JSON sample cannot prove every field that an API may return. This tool only maps the values present in the pasted sample. Add optional fields, stricter literal types, dates, and domain rules in your code after review.

Local processing

Pasted JSON stays in the current browser tab.

Mixed arrays

Different value types remain as explicit unions.

Empty arrays

No item type is invented for an empty array.

Safe property keys

Keys that need quoting stay quoted in output.

FAQ

Common questions

Does this create interfaces or a type alias?

It creates one exported type alias. Nested objects stay readable inline, which makes every inferred value visible in one result.

Why is an empty array unknown[]?

There is no item value to infer from. The tool shows that uncertainty instead of guessing a type.

Does this upload JSON?

No. Parsing and type generation happen only in your browser.

Keep working