Generate TypeScript interfaces from JSON. Runs entirely in your browser — nothing you paste is sent anywhere.
6 answers to what people ask most about the JSON to TypeScript.
Paste a real example of your data. The tool creates an exported interface for the root object and one for every nested object.
The objects in an array are merged into one interface. A key that is missing from some of the objects is marked optional with a question mark.
null. If a field can be either a value or null in your real data, edit the result to a union such as string | null, because one sample cannot show both.
It becomes unknown[] because there is nothing to infer from. Add an item to the sample, or change the type by hand.
Yes. Use the Root type name field. Nested interfaces are named from their keys, such as profile becoming Profile, and numbered if names clash.
Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.
Something not working? Tell us and we'll fix it.
Report an issue