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 ESimportstatements - • Converts
module.exportsintoexport defaultor named exports - • Promotes JSDoc
@param/@returnsinto real TypeScript type annotations - • Detects class-field assignments in constructors and emits typed declarations
- • Hoists
MyClass.prop = ...intostaticmembers - • Infers
private/protectedfrom naming conventions - • Adds
@ts-expect-errorscaffolding 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 ›Related tools and guides
CommonJS to ES Modules ›
Rewrite require/module.exports as modern ESM.
JSDoc to TypeScript ›
Promote JSDoc comments into inline TypeScript type annotations.
React JSX to TSX ›
Convert React .jsx to .tsx with automatic JSX detection.
Node.js to TypeScript ›
Migrate Express, Koa, or Fastify backends with Node-tuned tsconfig.json.
Generate tsconfig.json ›
Emit a compiler config tuned to your project's module system and target runtime.
JSON to TypeScript ›
Paste a JSON sample and get a TypeScript interface back.