JSON to TypeScript
Paste any JSON object or array and instantly get a clean TypeScript interface. Handles nested objects, arrays, nulls, and optional fields automatically.
Used 923 times
Output kind
Export
Null fields
JSON Input
TypeScript Output
Tip: auto-converts on paste · Ctrl+Enter to convert manually
About This Tool
What it does
- Infers TypeScript types from JSON values
- Generates separate interfaces for nested objects
- Merges schemas from arrays of objects — marks fields optional when not present in every element
- Handles
nullas optional (field?: Type) or typed (field: Type | null) - Outputs
interfaceortypesyntax with optionalexport
Type mapping
"hello"→string42/3.14→numbertrue/false→booleannull→nullor optional field["a","b"]→string[][{…}]→ named interface +TypeName[][1,"x"]→(number | string)[]{}→ nestedinterface
Common use cases
- Typing API responses in React / Next.js apps
- Generating interfaces from database query results
- Scaffolding types for new features quickly
- Converting third-party API docs (JSON samples) to typed models
All Free Tools
Explore our full collection of developer tools — no login, no limits.
CREESOL