JSON to TypeScript

Free JSON to TypeScript converter. Generate interfaces or types from JSON with nested objects, arrays and unions inferred automatically — copy the result, no signup.

Convert any JSON into TypeScript interfaces or types instantly, with nested objects, arrays, unions and optional properties inferred automatically.

Share
Category
Developer Tools
Includes
6 features
Access
Free · No sign-up
Privacy
Runs in your browser
JSON to TypeScript

Loading JSON to TypeScript......

Please wait a moment

How to use

How to use JSON to TypeScript

  1. 01

    Paste JSON

    Drop in an object or array of data.

  2. 02

    Set options

    Choose interface or type, name the root, mark nullables optional.

  3. 03

    Review the types

    Nested interfaces are generated automatically.

  4. 04

    Copy

    Copy the TypeScript into your project.

Use cases

Common use cases

  • Type an API response quickly
  • Generate models from a JSON fixture
  • Create interfaces for a config file
  • Bootstrap types for a new integration
Overview

Typed models from real data

Hand-writing TypeScript interfaces to match an API response is tedious and error-prone. Paste a JSON payload and this tool walks the structure, generating a matching interface (or type alias) with correctly-typed fields, nested interfaces for objects, and array element types. Mixed arrays become union types, so your models reflect the data exactly.

Tune the output to your style

Choose whether to emit interfaces or type aliases, name the root type, and optionally mark nullable fields as optional. The generated code updates live and is ready to paste into your project. It all runs in your browser, so private API payloads and internal schemas never leave your machine.

Features
01
Generate interfaces or type aliases
02
Handles nested objects & arrays
03
Infers union types from mixed arrays
04
Optional properties for nulls
05
Custom root type name
06
Runs locally — code never uploaded
FAQ

Frequently asked questions

How do I convert JSON to a TypeScript interface?+

Paste your JSON and the tool generates a matching interface instantly, creating nested interfaces for objects and inferring array element types. Copy it straight into your code.

Does it handle nested objects and arrays?+

Yes. Nested objects become their own named interfaces and arrays are typed by their elements. Arrays with mixed types produce a union like (string | number)[].

Can I get type aliases instead of interfaces?+

Yes — toggle the option to emit 'type' aliases instead of 'interface' declarations, and rename the root type to suit your project.

Is my JSON uploaded anywhere?+

No. Parsing and generation happen entirely in your browser, so sensitive payloads never leave your device.