JavaScript to TypeScript Converter
Paste your JavaScript and get TypeScript with inferred types, interface extraction, JSDoc-to-type migration, and strict-mode fixes — instantly in your browser.
Paste your JavaScript and get TypeScript with inferred types, interface extraction, JSDoc-to-type migration, and strict-mode fixes — instantly in your browser.
This tool converts JavaScript (.js) to TypeScript (.ts) by applying a comprehensive set of transformations: adding type annotations to function parameters and return types, extracting object shapes as interface declarations, converting JSDoc @param and @returns tags to TypeScript types, and enabling strict-mode compatible patterns.
any typesinterface definitions@param {type} name → TypeScript parameter typesvar → let / const (based on reassignment)const enumrequire() → ES module importmodule.exports → export statementsThis is a source-text converter, not a full TypeScript compiler. Complex runtime type narrowing, dynamic property access, and highly generic code may still require manual type annotation after conversion. For large codebases, consider using the official TypeScript compiler's allowJs flag as a starting point.