DeveloperTool 05
JSON to TypeScript
Skip the typing. Paste a representative JSON response and get interfaces for every nested object plus a root export type.
Generate types
20 / 232Result
WaitingRun the tool and the result appears here. Copy it or download it — nothing leaves this tab.
Privacy
Everything you type stays in this tab and is processed by JavaScript on your device. Nothing is uploaded, logged or stored on a server.
How to use it
Paste a JSON sample that represents the shape you expect.
Name the root type. Interface names are derived from each object key.
Copy the generated TypeScript into your project and adjust optional fields by hand.
When to use it
API clients
Bootstrap request and response types from a real payload.
Quick prototypes
Get typed data without writing interfaces manually.
Schema discovery
Understand the shape of an unfamiliar API response.
Questions
Are optional fields detected?
No. Everything present in the sample is treated as required. Add question marks for fields your API may omit.
What about null values?
A null becomes the null type. Widen it by hand if the field is sometimes a string or a number.
Does it send my JSON anywhere?
No. Generation happens entirely in the browser.
How are nested objects turned into types?
Each object becomes its own interface and the parent references it by name, so a deep response produces a small tree rather than one enormous inline type. Arrays of objects become arrays of the named interface.
What type is used for a field that is always numeric?
Number, unless the sample holds an integer that the generator can narrow; strings stay string and booleans boolean. The output follows the sample you paste, so a representative response gives better types.