— Data & developer

JSON to TypeScript Interface

Paste JSON and get clean, named TypeScript interfaces — nested objects, arrays, and merged shapes inferred automatically, all in your browser.

Drop a file here or click to choose — it never leaves your browser
— What it does

The JSON to TypeScript Interface generator is a free tool that infers strongly-typed TypeScript interfaces from any JSON sample. It builds a named interface for every nested object, types arrays by their element type, merges object shapes across array elements so optional keys are caught, and maps primitives to string, number, boolean, or null. Everything runs locally — your JSON never leaves the page.

  • Generates named, PascalCased interfaces for the root and every nested object.
  • Infers array element types and merges shapes across elements to find optional fields.
  • Maps mixed or unknown values to unions or unknown so the output stays type-safe.
  • Runs entirely in your browser — your JSON is never uploaded to a server.

How to use it

1

Paste your JSON

Paste a JSON object or array (an API response works great) into the input box.

2

Name the root interface

Set the name for the top-level interface — it defaults to Root. Nested interfaces are named from their keys.

3

Copy or download the types

The TypeScript updates as you type. Copy the interfaces or download them as a .ts file.

Frequently asked

Is my JSON sent to a server?
No. Type inference happens entirely in your browser with JavaScript. Your JSON is never uploaded, so it is safe to paste private API responses or production payloads.
How are arrays typed?
Arrays become element-type arrays. If every element is the same primitive you get something like number[]; objects are merged into one shared interface, and mixed primitive types become a union such as (string | number)[].
What happens with null or missing fields?
A null value is typed as null. When objects in an array have different keys, the shapes are merged and any key not present in every element is marked optional with a question mark.
Can I use this for API responses?
Yes. Paste a representative response and the tool produces ready-to-use interfaces. Including several array elements helps it detect optional fields and unions accurately.
— Built by saavos

These tools are free. So is the first version of your agent.

saavos is the AI agent that lives on your website — themed to match your design, answering visitors from your own content, and telling you what they actually want to know. Paste your URL and see it answer, before you install anything.

Make my site feel alive