JSON to TypeScript — Free Online Tool
Paste any JSON and get TypeScript interface/type definitions generated automatically. Handles nested objects (generates nested interfaces), arrays (infers item type from first element), and all primitive types. Options for optional fields, readonly, export keyword, and interface vs type alias.
100% client-side. No uploads. Your data never leaves your browser.
How to use JSON to TypeScript
- Paste a JSON object.
- Set the root interface name.
- Toggle optional, readonly, and export options.
- Copy or download the TypeScript interfaces.
Frequently Asked Questions
Does this handle nested objects?
Yes. Each nested object generates a separate interface. Types reference each other by name.
What about arrays?
Arrays infer their item type from the first element. Empty arrays become unknown[].
Should I use interface or type?
Both are valid. Interfaces are better for object shapes that may be extended. Types are more flexible for unions and intersections.
Related tools
Related reading
Browse all free tools · theproductguy.in