Skip to content
Developer Tools

JSON to TypeScript

Generate a TypeScript type from a JSON example. Review the inferred shape before using it in your project.

Free to use
No signup
Processes in your browser · How your data is handled

This tool processes input in your browser. Site analytics and advertising are separate from tool processing; see the privacy policy.

Types reflect one sample, not every possible response. Missing fields, optional properties, enums, and dates cannot be inferred reliably from one example. All JSON input rejects duplicate keys and unsafe numbers; maximum 1,000,000 characters and 64 levels.

About the JSON to TypeScript

Generate a TypeScript type from a JSON example. Review the inferred shape before using it in your project.

How to use this tool

Paste input or import a text file, select the options that match your data, and run the tool. Review the result before copying, downloading, or transferring it to another local tool.

What this tool will not do

  • Types reflect one sample, not every possible response. Missing fields, optional properties, enums, and dates cannot be inferred reliably from one example.
  • Empty arrays become unknown[]. Mixed arrays become unions, including separate object shapes when keys differ. Property names are escaped JSON strings.
  • This generates a type alias, not a runtime validator. Use JSON Schema validation when you need runtime data checks.
  • Nesting is limited to 32 levels; arrays allow at most 30 distinct inferred shapes.