JSON to TypeScript
Turn a JSON sample into TypeScript interfaces — instantly.
How to use
Paste a JSON sample and the inferred TypeScript interfaces appear below. Click Copy to grab them.
About this tool
Paste a JSON object or array and get clean TypeScript interfaces inferred from its shape, including nested objects and arrays. Great for typing API responses fast. It runs entirely in your browser — your JSON is never uploaded.
What you can use JSON to TypeScript for
- Type an API response from a sample payload
- Bootstrap interfaces for a JSON config
- Convert a fixture into typed test data
- Document the shape of a JSON structure
Frequently asked questions
How are types inferred?
The tool walks your JSON: objects become interfaces, arrays become typed arrays, and primitive values map to string, number, boolean, or null. Keys missing from some array items are marked optional.
Does it handle nested objects and arrays?
Yes. Nested objects generate their own named interfaces, and arrays of objects merge their keys into one element interface.
Is my JSON sent anywhere?
No — inference happens entirely in your browser.