JSON to TypeScript
Generate TypeScript interfaces from a JSON sample. Free, no sign-up, your data stays on your device.
🔒 100% private — processing happens in your browser. Nothing is uploaded.
How to generate TypeScript types from JSON
- Paste a JSON sample, for example an API response.
- Set the root name and choose interface or type.
- Tick export and readonly if you want them.
- Press “Convert” and copy the code.
Type your API responses
Writing interfaces for large API responses by hand is tedious. Paste a real response and get interfaces for every nested object, with arrays and optional values typed. Then add them to your project for autocompletion and type checking.
Check the result: one sample cannot show every possible value, for example fields that are sometimes null.
Questions and answers
Interface or type?
Both work; interfaces are common for objects and can be extended.
How are nested objects handled?
Each gets its own named interface.
Is my JSON uploaded?
No.
Is it free?
Yes, no sign-up.