Skip to content
Web4tools

JSON to TypeScript Interface Generator

Generate TypeScript types from an example JSON response.

Runs in your browserNo accountNo watermark

In short

To generate TypeScript types, paste a JSON sample (such as an API response) and copy the interfaces. Nested objects become their own named interfaces, arrays become typed arrays, and mixed arrays become union types, saving you from writing types by hand.

How to use the JSON to TypeScript Interface Generator

  1. 1Paste or type your input in the left box (or click "Try an example").
  2. 2Adjust the options if needed. The result updates as you type.
  3. 3Copy the result or download it as a file.

Review before you ship

Types are inferred from one sample, so optional fields and nulls that don't appear in your sample won't be marked as optional. Adjust the result with ? and | null where the API documentation says so.

Frequently asked questions

How are interface names chosen?

From the property names: an "address" object becomes an Address interface; array items use the singular form.

Can it generate Zod schemas?

Not yet. It outputs TypeScript interfaces.

Is my data sent anywhere?

No. Everything runs in your browser. What you paste is never uploaded, logged or stored, so it's safe for code, tokens and private content.

Last updated