Skip to content
M2TOOLKIT

JSON to TypeScript Interface Generator

Paste a sample JSON response and get TypeScript interfaces for it.

  • Free
  • No sign-up
  • Runs in your browser
Arrays of objects are merged; keys missing in some items become optional.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the JSON to TypeScript

  1. Paste a representative JSON sample.
  2. Name the root type.
  3. Copy the generated interfaces into your code.

What does this tool do?

Nested objects get their own named interfaces. For arrays of objects, all items are merged — a key that's missing from some items becomes optional — so the types reflect the real variety in your data.

Generated types are only as good as the sample, so use a response that includes optional fields where possible.

Why use it?

  • Type API responses in seconds.
  • Avoid hand-typing large interfaces.
  • Optional keys detected automatically.

Example

{"id":1,"tags":["a"]} becomes:
export interface Root {
  id: number;
  tags: string[];
}

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the json to typescript.