close
Skip to main content

Online JavaScript to TypeScript Converter

Paste your JavaScript source, press Convert, and get idiomatic TypeScript instantly. The engine rewrites CommonJS require/module.exports, promotes JSDoc @param and @returns into inline type annotations, detects class fields, and emits TypeScript that drops straight into a tsconfig.json-driven project. Free, no sign-up.

What this JavaScript to TypeScript converter does

This online tool runs the same deterministic conversion engine as our free Windows desktop app. It takes a single .js file and produces a .ts (or .tsx) file that preserves behaviour while modernizing syntax.

  • • Rewrites require() calls as ES import statements
  • • Converts module.exports into export default or named exports
  • • Promotes JSDoc @param/@returns into real TypeScript type annotations
  • • Detects class-field assignments in constructors and emits typed declarations
  • • Hoists MyClass.prop = ... into static members
  • • Infers private / protected from naming conventions
  • • Adds @ts-expect-error scaffolding where needed so compilation passes

When to use the online converter

The browser tool is ideal for single files, short utilities, or spot-checking how the engine will treat a tricky pattern before running a full project conversion.

For entire repositories, use the free desktop app — it converts hundreds of files in seconds with a full file tree, per-file diagnostics, and complete offline operation so your source code never leaves your machine.

Download the free desktop app ›