JSON to TypeScript
Paste JSON to generate TypeScript interfaces automatically.
Paste JSON to generate TypeScript interfaces automatically.
Paste JSON and get TypeScript interfaces back. Each nested object becomes its own named interface. Arrays are typed based on their contents. Primitive values map to string, number, or boolean. You can set the root interface name to match your domain.
Writing TypeScript types by hand from an API response is tedious and error-prone. Paste the JSON payload here and get accurate interfaces in seconds. It's especially useful when you're integrating a new API or working with complex nested data structures.
The tool walks through every key in your JSON, checks the value type, and builds an interface definition. Objects get their own interface. Arrays check all elements to determine the item type. If an array has mixed types, they're combined with a union. Special characters in keys get quoted. The output is ready to paste into your .ts file.