JSON to TypeScript Interface Generator

Generate TypeScript interfaces from a JSON sample, with nested objects, arrays, unions and optional properties.

How to use JSON to TypeScript Interface Generator

  1. Paste a representative JSON sample.
  2. Set the name of the root interface.
  3. Copy the generated interfaces or download types.ts.

Supported features and limitations

Types are inferred from your sample only: numbers become number, null stays null, keys missing from some array items become optional and mixed values become unions. Dates arrive as strings. Always review the output.

Privacy

Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.

Frequently asked questions

Does it detect dates?

No, ISO date strings are typed as string.

Can it handle arrays of objects?

Yes, items are merged into one interface with optional keys where they differ.

Related tools

More Developer & Webmaster Tools · All free tools