About the TypeScript generator
Infer TypeScript interfaces and types from a representative JSON sample.
What it infers
- Nested objects become named interfaces.
- Arrays merge the observed element shapes.
- Missing properties in merged object samples become optional.
- Null values are represented as nullable unions.
- Property names can stay unchanged or be converted to camelCase.
How to use it
- Paste representative JSON, including the variations you need the type to cover.
- Set the root type name and naming preference.
- Generate and review the TypeScript before using it in a project.
Notes
Inference reflects only the supplied sample. Date-like strings remain string types, and mixed samples may produce unions or unknown where a single safe type cannot be inferred.
Privacy
Schema inference and code generation happen locally in your browser. The JSON sample is not uploaded.