<!-- Markdown version of https://ocxly.com/json-to-typescript.html · auto-generated, may lag the live page -->

# JSON to TypeScript

Paste JSON and get typed TypeScript `interface`s — nested objects become their own interfaces and arrays are unified to `T[]`. Generated entirely in your browser.

### How it works

Your JSON is parsed locally and walked to infer a TypeScript `interface` for every object it contains. Nested objects become their own named interfaces, arrays become `T[]` (unifying element types into a union where they differ), and primitives map to `string`, `number`, `boolean` or `null`. Empty arrays become `unknown[]`, and you can optionally mark null-valued keys as optional. Nothing is uploaded.

---
*Source: [ocxly.com/json-to-typescript.html](https://ocxly.com/json-to-typescript.html) — OCXLY, free 100% client-side privacy-first tools. Free JSON-to-TypeScript interface generator with nested type inference, entirely in your browser.*
