Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

JSON to TypeScript

Generate TypeScript interfaces and types from JSON instantly. Merges array item shapes, detects optional properties, and names nested types.

Processed locally in your browser — nothing is uploaded.

0 characters

TypeScript

Output appears here…

About JSON to TypeScript

Paste a JSON sample (an API response, a config file) and get TypeScript definitions for it. Nested objects become their own named types, array items are merged so properties present in only some items become optional, and keys that aren't valid identifiers are quoted.

Choose between interface and type declarations, set the root type name, and toggle export, semicolons, and readonly.

Common uses

  • Type an API response you don't control
  • Bootstrap types for a config format
  • Get a head start on modeling third-party webhook payloads

Example

Input

{"id": 1, "name": "Ada", "tags": ["a"]}

Output

export interface Root {
  id: number;
  name: string;
  tags: string[];
}

Limitations

  • Types are inferred from one sample — fields that can be null or absent in other samples won't be marked unless the sample shows it