Skip to content
Work data is processed in your browser, not stored on our servers.
tools
JSON to TypeScript Converter

JSON to TypeScript Converter

Analyze a JSON object or array and generate nested TypeScript interfaces or type aliases.

JSON → TypeScript converter
Paste JSON to convert it into TypeScript interfaces. All processing happens in your browser, and the data is not sent to a server.

Key features

  • Infers nested TypeScript structures from JSON objects and arrays.
  • Switches output between interface declarations and type aliases.
  • Sanitizes an optional root name into a valid TypeScript identifier.
  • Validates JSON syntax and the top-level data shape before conversion.

How to use

  1. Enter JSON whose root is an object or array.
  2. Optionally set a root name and enable type aliases.
  3. Copy the generated TypeScript declarations.

Examples

  • Draft an API response type

    Generate nested TypeScript structures quickly from sample JSON.

  • Type mock data

    Paste an object array and create a reusable interface or type alias.

Privacy

JSON parsing and TypeScript type generation run in your browser.

Requirements

The top-level JSON must be an object or array, and generated types are inferred from the sample values.

Common questions

Does it inspect multiple array items?
It examines array element shapes to form a shared TypeScript type, but the result reflects only the supplied sample and cannot cover unseen API variants.
Can I choose between interface and type?
Yes. Switch the declaration style between interfaces and type aliases and set the root type name.