loot.tools

JSON to TypeScript

Paste a JSON object or array and get TypeScript interfaces generated automatically. Nested objects become separate interfaces. Set a custom root name.

Paste JSON to generate TypeScript interfaces automatically.

JSON Input
TypeScript Output

What this tool does

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.

Why you'd use this

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.

How the conversion works

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.

© 2026 loot.toolsYour data stays in your browser.