DevKit Labs

JSON to TypeScript Converter

Generate TypeScript interfaces from a JSON sample — nested types and optional fields, 100% in your browser.

JSON
TypeScript

About JSON to TypeScript Converter

Paste a JSON object and get ready-to-use TypeScript interfaces. Nested objects become their own named interfaces, arrays of objects are merged into a single shape with fields marked optional when they don't appear in every element, and keys that aren't valid identifiers are quoted automatically.

Set the root interface name to match your model. Everything runs locally in your browser — your JSON is never uploaded — which makes it safe for API responses and other sensitive payloads.

Object to interfaces

Input
{ "name": "Ada", "tags": ["dev"], "address": { "city": "NYC" } }
Output
export interface Root {
  name: string;
  tags: string[];
  address: Address;
}

Nested objects and arrays of objects get their own named interfaces.

Frequently asked questions

How are nested objects handled?

Each nested object becomes its own interface named after the key (PascalCase), and the parent references it by name.

How are arrays typed?

Arrays of objects are merged into one element interface; a field that's missing from some elements is marked optional. Arrays of primitives become e.g. string[] or a union like (string | number)[].

What about fields with invalid identifier names?

Keys that aren't valid TypeScript identifiers (like “zip-code”) are quoted in the generated interface.

Is my JSON uploaded anywhere?

No. The conversion happens entirely in your browser.

Related tools