JSON to TypeScript Interface

Create TypeScript interfaces from a JSON sample.

Free · Runs in your browser · Your text is never uploaded

A JSON object converted into a TypeScript interface

From API response to types

Copy a JSON response from your API or browser dev tools and paste it. Each nested object becomes a named interface, arrays are typed, and keys missing from some items become optional.

Reviewing the result

A generator only sees your sample. Replace broad types with unions where you know the possible values, for example a status string, and check fields that can be null.

Your files stay on your device

Everything happens in your browser. The files are never uploaded, so confidential documents stay private and the tool also works on a slow connection once the page has loaded.

Interfaces from JSON

Nested objects become their own named interfaces and arrays are typed from their elements. Review field names that are not valid identifiers, which are quoted, and make fields optional where an API may omit them.

Need more options? Open the full JSON to TypeScript Converter.

Related guides

Frequently asked questions

How do I generate an interface from JSON?

Paste the JSON. The interfaces appear instantly and can be copied.

Can it generate type aliases instead?

Yes. Choose type alias in the options.