JSON to TypeScript
Paste a JSON sample and get ready-to-use TypeScript interfaces, including nested objects and arrays.
How it works
- 1
Paste your JSON
A sample response from an API.
- 2
Name the root interface
Root by default.
- 3
Copy the interfaces
Paste them into your TypeScript project.
Related tools
Other tools people use right after this one.
Built to get out of your way
487
Tools available
6
Languages
0
Watermarks added
2h
Until your files are erased
100%
Free to start
∞
Devices supported
Frequently asked questions
No, a single sample cannot show which fields are optional. Add ? by hand where needed.
Typing API responses quickly
When you consume an API in TypeScript, writing interfaces by hand for a large response is slow and error-prone. Generating them from a real sample gives you accurate field names and types in seconds.
Strings, numbers, booleans and null are mapped to their TypeScript types, arrays are typed from their first element, and nested objects become their own interfaces. Review optional fields by hand, since one sample cannot show them all.