How to use it
- Paste JSON into the input box.
- Choose the root name and whether to use interface or type.
- Press Generate, then copy the result into your project.
How it works
The generator reads your JSON and works out a type for every value. Objects become interfaces named after their key, arrays are merged so that every item contributes to one element type, and keys that appear in only some items become optional. Names are turned into valid PascalCase identifiers.
Frequently asked questions
How are optional fields found?
When the input is an array of objects, a key that is missing from some items is marked optional with a question mark.
What happens with null values?
A null value becomes the type null. If the same key is a string in one item and null in another, the result is string | null.
Does it handle nested objects and arrays?
Yes. Each nested object gets its own named interface, and arrays become typed lists such as Item[].
Are the types guaranteed correct?
The types describe the sample you paste. If other data can differ from the sample, add more examples to the array or edit the result by hand.