Auto-generate TypeScript interfaces and types from any JSON sample - handles nested objects, arrays, optional fields, and unions. Copy-paste ready output.
JSON to TypeScript Features
- Auto Generation — Paste JSON and get TypeScript interfaces or types instantly
- Nested Objects — Each nested object gets its own named interface
- Configurable — Toggle between interface/type, optional fields, custom root name
- Syntax Highlighted — Color-coded output with one-click copy to clipboard
How to Use JSON to TypeScript
Generate TypeScript from JSON in three steps
- Paste JSON — Paste your JSON in the left panel
- Configure — Choose interface vs type, set root name
- Copy TypeScript — Copy the generated code to your project
Frequently Asked Questions
Does it handle nested objects?
Yes, each nested object gets its own named interface. Arrays are typed by their contents.
Can I use 'type' instead of 'interface'?
Yes, toggle between 'interface' and 'type' keyword with one click.
Does it handle optional fields?
Yes, toggle 'all optional' to add ? to every field.
Is this free?
Yes, runs entirely in your browser. No data sent to any server.
Related: json to typescript, json to interface, typescript interface generator, json to ts, json2ts, generate typescript from json