Developer Tools
JSON to TypeScript
Paste any JSON payload and instantly get clean TypeScript interfaces. Handles nested objects, arrays of mixed shapes, optional fields and union element types — all generated in your browser, nothing uploaded.
Your input is processed locally in your browser. It is not uploaded to Dueneo.
Loading JSON to TypeScript…
How to use
- 1
Paste your JSON
Drop any valid JSON — an API response, a config file, a fixture — into the left-hand editor.
- 2
Pick a root name and style
Name the top-level interface (default `Root`) and choose between `interface` and `type` declarations.
- 3
Toggle optional fields
When an array contains objects with differing keys, the missing keys become optional (`?`) fields. Turn this off to force every field required.
- 4
Generate and copy
Click Generate. Nested objects get their own interfaces named after the parent key (singularised for arrays). Copy the result straight into your `.ts` file.
Common use cases
- Generate TypeScript types for an API you don't control and don't have an OpenAPI spec for.
- Turn a JSON config fixture into strict types so future edits are caught at compile time.
- Quickly sketch the shape of a third-party webhook payload before writing the handler.
- Bootstrap a typed client for an internal service from a sample response.
Limitations
- Inputs larger than 1 MB are rejected to keep the tab responsive.
- The union-of-primitives inference is structural — `42` and `\"hello\"` in the same array become
number | string, not a string-literal union. - Empty arrays become
unknown[]because the element type cannot be inferred. - String enums and string-literal unions are not detected — every string becomes
string. - JSON keys that aren't valid identifiers are emitted as quoted property names.