JSON to TypeScript

Generate TypeScript interfaces from a JSON sample — nested objects and arrays included.

JSON input
TypeScript output

How the generator works

Each nested object becomes its own exported interface, named after its key (e.g. address → Address). Arrays are typed as T[] from the union of their element types; mixed arrays fall back to a union type. The value null adds | null to the property type.

FAQ

Are optional fields detected?

Optionality is inferred per array: if an object key is missing in sibling records of the same array, it is generated as optional (?:).

Is my JSON uploaded?

No. Generation runs entirely in your browser.

JSON to TypeScript — FAQ

Is JSON to TypeScript free to use?

Yes. It is completely free, with no signup, no installation and no usage limits.

Is my data uploaded to a server?

No. The tool runs entirely in your browser — the data you paste or upload never leaves your device.

Does it work on mobile devices?

Yes. It works in any modern desktop or mobile browser, with nothing to install.