Skip to content
Toolbrik

JSON to TypeScript (Interfaces)

Paste a sample JSON and get ready-to-use TypeScript interfaces, with inferred types (string, number, boolean, arrays and nested objects). Choose the root type name and copy or download the result.

Input JSON

TypeScript interfaces

Paste a JSON to generate its TypeScript interfaces.

How to use: JSON to TS

  1. 1Paste a sample JSON.
  2. 2Name the root type.
  3. 3Copy or download the generated TypeScript interfaces.

What is it for?

  • Type API responses in TypeScript projects.
  • Save time when integrating external services.
  • Document data structures.

From JSON to TypeScript types

Saving work

Paste a sample response and get interfaces with inferred types: string, number, boolean, lists and nested objects.

Review the result

A single example does not reveal optional fields or values that can be null or have several types. Complete the type with ? and unions according to the real API contract.

Runtime validation

TypeScript only checks at compile time. For external data, combine types with runtime validation (for example with a schema) before trusting it.

Related tools

Frequently asked questions

How does it name nested types?+

Each nested object generates its own interface named after the parent plus the capitalized property name. If there are collisions, a number is added.

What does it do with arrays of objects?+

It infers one interface per element using the Item suffix (e.g., RootObjectItem).

Was "JSON to TS" useful?

Share it with whoever needs it. It's free and stores no data.