JSON to TypeScript
Paste JSON and get TypeScript interfaces — nested objects, arrays and unions handled automatically.
// output appears here
Hand-writing TypeScript types for a messy API response is tedious and easy to get wrong. Paste the JSON and this tool turns it into clean interfaces, unions, and type aliases you can drop straight into a project.
How to use the json to typescript
- Paste a JSON object into the input box (or load the sample).
- Press Generate interfaces.
- Copy the generated TypeScript and paste it into your source file.
- Adjust any names the tool guessed — it derives property names from the JSON keys, which is usually what you want.
Frequently asked questions
What TypeScript does it generate?
Interfaces and type aliases that describe the shape of your JSON, including nested objects and arrays of objects, with sensible string, number, boolean and null types.
Can I convert TypeScript back to JSON?
This tool goes one way, from JSON to TypeScript. It is meant for typing an API response you already have.
Does it run offline?
Yes. Once the page loads, the conversion happens in your browser and your JSON is never uploaded.
How do I type an array of objects?
Paste an array at the top level and the tool generates an element interface plus a matching array type for it.