Skip to content
Developer & CodeLocal · Stays on device

TypeScript Type Generator

Generate TypeScript interfaces or type aliases from sample JSON, with optional keys and nullable fields inferred.

  • Works on desktop and phone
  • Free to use
  • No sign-up or watermark
typescript-type-generatorOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10

About this tool

Paste a JSON API response or config and get TypeScript types for it. Nested objects become their own named interfaces (array items get singular names, so users becomes User), keys that are missing from some array items become optional, null values add | null, and arrays holding mixed values become union arrays. Keys that aren’t valid identifiers are quoted.

Choose interface or type declarations, export, readonly properties, and whether missing keys are written key?: T or key: T | undefined. Types are inferred from the sample you paste, so check them against your API’s documentation — a sample can’t show every possible value. Everything runs in your browser. Your data is never uploaded, logged or stored.

  1. Input

    Your code or text

    Pasted or opened from a file

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelineInstant, in-browser

How to use it

  1. 1

    Paste sample JSON.

  2. 2

    Set the root type name and declaration options.

  3. 3

    Copy the types or download types.ts.

Zero-upload architecture

How to use TypeScript Type Generator for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open TypeScript Type Generator

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Set the root type name and declaration options.

  3. 3

    Get your result

    Copy the types or download types.ts.

  • Local

    JSON Schema Generator

    Infer a starter JSON Schema (draft 2020-12) from sample JSON, with types, nested objects, arrays, required keys and formats.

    Open tool
  • Local

    JSON Formatter

    Pretty-print, beautify and validate JSON with precise error locations, key sorting and custom indentation.

    Open tool
  • Local

    GraphQL Schema Viewer

    Browse a GraphQL schema from SDL or introspection JSON: types, fields, arguments, enums, unions and deprecations.

    Open tool
  • Local

    JSON Studio

    Edit, validate, format and explore JSON with a code editor, tree view and table view, then convert it to CSV, YAML or TypeScript.

    Open tool