JSON to TypeScript
Generate TypeScript interfaces from any JSON sample, nested types included.
Runs entirely in your browser — nothing is uploaded.
About the JSON to TypeScript
The Freemium.Tools JSON to TypeScript converter reads a JSON sample and generates matching TypeScript interfaces or type aliases, including nested objects and arrays.
Typing an API response by hand is tedious and error-prone, especially when the payload is deeply nested. One sample response contains everything needed to describe the shape.
Paste the JSON, name the root type, and get a complete set of exported interfaces with nested objects extracted into their own named types. Nulls become optional properties, and mixed arrays become union types.
How to use it
- 1Paste a JSON sample. Use a real API response so optional and nested fields are represented.
- 2Name the root type. For example User or ApiResponse; nested types are named from their keys.
- 3Copy into your project. Copy the interfaces or download a ready-made types.ts file.
Frequently asked questions
Does it handle nested objects and arrays?
Yes. Nested objects become their own exported interfaces named after the key, and arrays become typed arrays or a union when their items differ.
What happens to null values?
A null value becomes an optional property typed as null, because a single sample cannot reveal the real type. Adjust it once you know the full shape.
Interfaces or type aliases?
Interfaces are the usual choice for object shapes and support declaration merging; type aliases are handy in unions. Both are offered.
Is the JSON uploaded?
No. Parsing and generation happen in your browser, so production payloads stay on your machine.

