🔨 JSON to TypeScript Converter

Generate TypeScript interfaces and types from JSON data. Runs in your browser.

Last updated: November 8, 2026 · By the BoltQuickTools team

1

          

Turning a sample response into TypeScript types

You have a real API response and need a first draft of its types without typing every field by hand. This page reads one JSON sample and writes matching interfaces or type aliases. Because it only sees that one sample, treat the output as a draft to review.

Settings above the panels

Paste into JSON Input. Output in TypeScript Output updates shortly after you stop typing, and immediately on paste or when you press Convert.

From sample response to interfaces

{"id":7,"name":"Ada","created_at":"2026-03-01T09:00:00Z","nick":null,
 "home_address":{"city":"Oslo"},"tags":["a","b"],
 "orders":[{"sku":"A1","qty":2},{"sku":"B2","gift":true}]}

generates:

export interface HomeAddress {
  city: string;
}

export interface Orders {
  sku: string;
  qty: number;
  gift: boolean;
}

export interface Root {
  id: number;
  name: string;
  created_at: string; // ISO date string;
  nick: null;
  home_address: HomeAddress;
  tags: string[];
  orders: Orders[];
}

Child types come first and the root type last. Look at Orders: the second order had no qty and the first had no gift, yet both are required in the output.

What to fix by hand

Using the generated types

Should I choose interface or type here?

For this output the only practical difference is how duplicates behave, as noted above. Follow your project's convention. TypeScript tips covers refining generated types, including nullable and optional fields.

Can it give me runtime validation?

No, the output is compile-time types only. To check real data, write a schema and test with the JSON Schema Validator.

Should I paste one record or many?

Put several varied records in one array. Key merging only sees what you paste, so a fuller sample finds more fields. Types for repeated keys still come from their first appearance.

If you already have a schema, the JSON Schema to Code Generator works from that instead of a sample.