JSON → TypeScript

Generate TypeScript interfaces or types from a JSON sample.

Private by design. Your input never leaves this browser. Conversions run locally on your device.

What this tool handles

  • Emits an interface or a type alias, named from the root type name you choose.
  • Nested objects become their own named interfaces rather than inline literals.
  • Unknown and mixed types are written as unknown or any, whichever you select.
  • Types describe the sample you paste: a field that is never null in the sample is not optional.

Example

JSON sample

{"id":1,"name":"Ada","address":{"city":"London"},"tags":["a","b"]}

TypeScript

export interface Address {
  city: string;
}

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

Related tools

Browse all 25 tools