CloudAlls Tools
Converters tool

JSON to TypeScript

Generate TypeScript interfaces or types from a JSON sample.

✦ Browser-first
Why it is useful

About this tool

Turn any JSON sample into clean TypeScript interfaces or type aliases, with nested objects, arrays, unions and optional properties inferred automatically.

Quick guide

How to use the JSON to TypeScript

  1. Paste a representative JSON sample.
  2. Set the root name and choose interface or type.
  3. Copy the generated TypeScript.

Common uses

  • Typing API responses
  • Bootstrapping data models
  • Documenting JSON payloads
FAQ

JSON to TypeScript questions

How are optional properties detected?

If a key appears in some array items but not others, it is marked optional.

What about null values?

They become the null type. Combine samples with real values to see unions.

Is one sample enough?

The types reflect only your sample, so use a payload that shows the variety you expect.