How types are inferred
| JSON | TypeScript |
|---|---|
| "text" | string |
| 42, 4.2 | number |
| true | boolean |
| null | null |
| {…} | a named interface |
| [1, 2] | number[] |
| [{…}, {…}] | one merged interface; keys missing in some items become optional |
| [1, "a"] | (number | string)[] |
Related tools
Frequently asked questions
How accurate are the types?
They describe your sample exactly; real data may have more variations.
What are optional fields?
Keys that appear in some array items but not others are marked with ?.
Interface or type?
Both work for objects; choose your team’s convention.
How are nested objects named?
From their key, e.g. address becomes Address.
What about empty arrays?
They become unknown[] because the item type cannot be inferred.
Are dates detected?
No – dates in JSON are strings.
Can I generate Zod schemas?
Not yet.
Does it handle large JSON?
Yes, though very large samples produce many types.
What if two nested objects share a name?
A number is added, e.g. Item2.
Is my JSON uploaded?
No.
Are keys with spaces supported?
Yes – they are quoted.
Does it export the types?
Yes – every type is exported.
What if the root is an array?
An item interface plus a root type alias is created.
Can I use the output in JavaScript with JSDoc?
Not directly – it is TypeScript syntax.
Is my code uploaded?
No – it is processed in your browser and never leaves your device.
Is it free?
Yes, with no sign-up or limits.
Can I open a file?
Yes – use “Open file”, or paste the code.
Does it work offline?
Once the page and its library have loaded, yes.
Can I copy or download the result?
Copy it with one click, or download where offered.
Does it work on a phone?
Yes, though large files are easier on a computer.
Last reviewed: 8 November 2026.