JSON to TypeScript
Infer TypeScript interfaces and type aliases from JSON.
Processing locally…
Your input is processed locally in this browser tab.
How to use JSON to TypeScript
Paste sample JSON payloads, API responses, or config objects.
Review the inferred exported TypeScript interfaces and root type alias, with optional fields and union types resolved across arrays.
Copy or download the generated .ts definitions.
Frequently asked questions
How are arrays of objects with differing keys handled?
Object shapes across array items are merged cleanly; fields missing from some items become optional (?) or unioned cleanly.
What if a property name contains hyphens or spaces?
Non-identifier property names are quoted automatically so the generated TypeScript compiles cleanly.