# 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. ## Related tools - [CSV to JSON Converter (and Back)](csv-json.html) - [YAML to JSON Converter (and Back)](yaml-json.html) - [XML Formatter & Validator](xml-formatter.html) โ€” Pretty-Print XML --- *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.*