🧩
About the JSON to TypeScript
The JSON to TypeScript converter turns a JSON sample into typed interfaces. Paste an API response and get a starting point for typed models instead of writing every field by hand.
Treat the output as a first draft rather than a contract. Real APIs often return null or omit fields, so review the interfaces and add optional markers where the service allows it.
- ✓Handles nested objects and arrays
- ✓Quotes keys that are not valid identifiers
- ✓Runs locally in your browser
How to use the JSON to TypeScript
- 1
Paste a JSON object or array.
- 2
Name the root interface.
- 3
Copy the generated TypeScript.
Frequently asked questions
Does it infer optional fields?+
It types the sample you provide. Fields missing from the sample are not included, so check the result against the real API contract.
What happens with arrays of mixed values?+
The generator combines the observed types into a union, which you may want to tighten by hand.
Save JSON to TypeScript to your favorites, or keep browsing converters.
Browse all 45 converters →