Tools / JSON to TypeScript
JSON to TypeScript
Paste JSON on the left to generate TypeScript interfaces or type aliases on the right. Infers optional fields from null values.
Runs entirely in your browser
Style:
Name:
JSON Input
TypeScript Output
JSON Input
TypeScript Output
How to use JSON to TypeScript
Paste sample JSON
Paste a representative JSON value on the left. The TypeScript inference appears on the right.
Pick interface or type
Toggle between interface and type alias. Choose readonly fields and inline-vs-named subtypes for nested objects.
Set the root name
Name the root type so it slots into your codebase without renaming.
Copy or download .ts
Copy the result to your editor or download a .ts file.