JSON → TypeScript
Generate TypeScript interfaces from JSON.
About this tool
Paste any JSON sample and get strongly-typed TypeScript interfaces or types. Detects optional fields by merging arrays of objects with different shapes.
Features
- interface or type output
- Merges array elements into a single shape with optionals
- Names nested types from their key
- Quoted keys for non-identifiers
How to use it
- Paste a JSON example.
- Set the root type name.
- Copy the generated TypeScript.
🔒 100% private
Everything happens inside your browser using JavaScript and WebAssembly. Your files are never uploaded to a server, never stored, and never seen by us.
Frequently asked questions
Can it infer string literal unions?
Currently it produces 'string'; literal-union inference is on the roadmap.