Runs locally in your browser

JSON to TypeScript Converter

Turn sample JSON into clean TypeScript interfaces or type aliases. Nested objects and mixed arrays are inferred automatically.

TypeScript output
✓ Types generated automatically in your browser

How to convert JSON to TypeScript

  1. Paste a representative JSON object or array.
  2. Choose a root name and interface or type alias output.
  3. Enable optional fields or date detection when appropriate.
  4. Copy the generated declarations into your TypeScript project.

Use representative sample data

Generated types describe the values present in the sample. Include several array items and realistic null or optional fields to get a more accurate result. Always review generated types before treating external API data as trusted.

Frequently asked questions

How are TypeScript types inferred from JSON?

Strings, numbers, booleans, null values, arrays, and nested objects are inspected recursively. Objects in the same array are merged, and fields missing from some items become optional.

Should I generate interfaces or type aliases?

Interfaces work well for object-shaped application models and can be extended or declaration-merged. Type aliases are useful when your codebase consistently prefers type syntax. For generated object models, either option is valid.

Is my JSON sent to a server?

No. JSON parsing and TypeScript generation run entirely in your browser.

Related tools