JSON to TypeScript
Auto-generate TypeScript type definitions from JSON data with multiple output styles and code options.
Generation Settings
Code Options
Usage
Why JSON to TypeScript?
- Auto-generate type definitions from API responses, reducing manual writing effort
- Ensure frontend code stays consistent with backend data structures
- Leverage TypeScript type checking to catch potential issues at compile time
- Provide better IDE auto-completion and documentation hints
Output Style Description
- InterfaceInterface: Uses the interface keyword to define types, supports declaration merging and extension
- Type AliasType Alias: Uses the type keyword to define type aliases, more flexible, supports union and intersection types
Code Options Description
- Add exportAdd export: Adds the export keyword to each type declaration for easy module export
- readonly membersreadonly members: Marks interface properties as readonly, enforcing immutability
- Unions over enumUnions over enum: Enum fields use type X = "a"
Configuration Options
Customizable root type name, output style (interface/type), whether to add export keyword, whether to use readonly members, whether to use unions over enum. Powered by quicktype engine, nested objects auto-generate corresponding sub-types, arrays infer element types and generate unions, optional fields are auto-inferred by the engine.
Related tools
More from the same category · Developer Tools
Cron ExpressionVisual Cron builder: pick minute-hour-day-month-weekday fields and preview next run times live.JSON FormatterJSON beautify, minify and validate with auto error location for missing brackets and stray commas.Timestamp ConverterConvert Unix timestamps to dates and back with second/millisecond precision and live current time.Regex TesterTest regex with live match highlighting, capture groups and substitution, toggling g/i/m/s flags.JWT ParserSplit a JWT into header, payload and signature, then base64url-decode claims and expiry without a key.JWT GeneratorIssue JWTs with custom header, claims and expiry across HS256, RS256, ES256 for auth-flow testing.