Skip to main content
Waiting for JSON. Paste, upload or drop a file.

The formatted result appears here once the JSON is valid.

Runs in your browser. Your JSON is never uploaded.

Free tool by GoodAI

JSON to TypeScript: Generate Interfaces Online

Paste a JSON sample and get TypeScript interfaces on the right. Nested objects become their own interfaces, and array items are merged into one type.

Generate TypeScript interfaces from JSON

Paste an API response, a config file or any JSON sample. The Type view reads the structure and writes exported interfaces you can copy straight into your project. Each nested object gets its own interface, named after the key it sits under.

How types are inferred

  • Strings, numbers and booleans map to string, number and boolean.
  • Arrays become T[] where T is the merged type of all items, so mixed arrays give a union such as (string | number)[].
  • A key missing from some objects in an array becomes optional (key?: type).
  • null is kept as null, and empty arrays become unknown[].
  • Keys that are not valid identifiers, such as "first-name", are quoted.

Tips for better results

The output is only as good as the sample. Use a response that includes optional fields and several array items so the generator can see the variation. Review the result before you ship it: dates arrive as strings, and numbers that are always whole are still typed as number.

Related JSON tools

Frequently asked questions

Does it support nested objects and arrays?+

Yes. Nested objects become separate interfaces, and arrays of objects are merged into a single item interface with optional keys where needed.

Does it generate types or interfaces?+

Objects become exported interfaces. A root array or primitive becomes a type alias.

Is my JSON sent to a server?+

No. The types are generated in your browser.

Looking for AI tools with demo videos?

Browse GoodAI