JSON to TypeScript
Paste JSON and instantly generate matching TypeScript interfaces, with nested objects and arrays turned into their own named types. Free and private, right in your browser.
Paste a JSON payload (an API response, a config file, a log entry) and get back TypeScript interfaces with correct field types, nested object types, and optional/array handling, no more hand-writing types for a shape you already have an example of.
How to use it
- Paste or upload your JSON
- Set the root interface name
- Copy or download the generated .ts file
Frequently asked questions
- Does it handle nested objects and arrays?
- Yes. Nested objects become their own named interfaces, and arrays are typed from their first element (or unioned across elements if they differ).
- What happens with fields that are sometimes null?
- A field that's null in some samples and a real value in others is typed as a union, e.g. `string | null`, rather than falling back to `any`.
- Can I use this for an API response with inconsistent fields?
- Paste a few sample responses if the shape varies. The generator merges them into one interface and marks fields that don't appear everywhere as optional.
- 1
Nothing is uploaded
The file never leaves your device. There is no server to send it to, so there is nothing to leak, log, or subpoena.
- 2
No signup, no limits
No account, no email, no daily cap, no watermark, and no paid tier waiting behind the third file.
- 3
Works offline
Load the page once and it keeps working with the network off, because all the work was always happening locally.