JSON to TypeScript
Generate TypeScript interfaces from any JSON sample.
Three steps, no reading required.
Paste your input
Drop text, code, or data into the input pane — from an API response, a file, anywhere.
See it process
The result updates instantly as you type.
Copy the result
Grab the output with Copy or Download, or fix the error shown if the input is invalid.
Try it with a sample.
{"id":1,"name":"Ada","active":true,"roles":["admin","user"],"address":{"city":"London","zip":"NW1"}}One giant inline type
- Dumps everything into a single nested type
- Misses fields absent from some array items
- Sends your sample payload to a server
Named interfaces, merged arrays
- Each nested object becomes its own named interface
- Keys missing from some array elements become optional (?); differing types become a union
- Generated in your browser
Questions worth answering upfront.
No. Interfaces are generated entirely in your browser. Your JSON is never uploaded, stored, or logged.
Each nested object becomes its own named interface, referenced from the parent — so you get clean, reusable types instead of one giant inline type.
The tool merges every object in the array: a key missing from some elements is marked optional (?), and keys with differing value types become a union.
If a sample value is null the tool can't infer its real type, so it uses null. Replace it with the correct type, or provide a sample where the field has a value.
Yes. Every tool on DevUtilsNow is free to use with no account required.
Interfaces, one per object shape, named after the property they came from. If you prefer type aliases, the bodies are identical: change interface Name to type Name =.
People who use this also reach for
Guides that pair with this tool
How to Generate TypeScript Interfaces from JSON
Turn a JSON API response into TypeScript interfaces — how nested objects, arrays, optional fields, and unions are inferred, and what to check.
Need another tool?
36+ browser-based utilities — all free, all private, nothing to install.