JSON to TypeScript Converter
Paste a JSON sample to generate matching TypeScript interfaces, including nested objects and arrays.
Your files are processed locally in your browser. They are not uploaded to our servers.
How to use
- Paste a sample JSON object or array into the input box.
- Click Convert to TypeScript.
- Copy the generated interfaces into your code.
What is this tool?
JSON to TypeScript Converter walks through a parsed JSON value and infers a matching set of TypeScript interfaces, generating a separate interface for each distinct nested object shape and reusing one when the same shape repeats. You can set the root type's name and switch between interface and type syntax for every generated type. Everything runs entirely in your browser using JavaScript.
Common uses
- Generating types for an API response you don't have a schema for
- Bootstrapping TypeScript types from a sample config or data file
- Quickly checking the shape of a JSON payload while debugging
- Turning a fixture file into properly typed test data
Related tools
FAQ
How does it handle arrays of objects?
It infers the interface from the first item and reuses that interface for the whole array when all items share the same shape.
Can I choose type aliases instead of interfaces?
Yes, switch the type style setting between interface and type — every generated type, including nested ones, follows your choice.
What happens with property names that aren't valid identifiers?
They're quoted automatically, for example a property named first-name becomes "first-name": string.
Is my JSON sent to a server?
No, the conversion runs entirely in your browser using JavaScript — nothing you paste in is ever uploaded.