TypeScript to JSDoc comments
Turn TypeScript function and interface types into JSDoc comments so the types survive plain JavaScript.
TypeScript to JSDoc comments
Paste a TypeScript function, arrow function, interface or type alias and this tool writes the matching JSDoc comment above it — `@param` for every parameter, `@returns` for the return type, and `@typedef` with `@property` lines for object-shaped interfaces and type aliases. It is built for moving code from `.ts` to plain `.js` without losing the type information an editor or a JSDoc-aware linter still needs.
"Remove TypeScript annotations" strips the type syntax from the signature itself — parameter types, return types, generic parameter lists — leaving valid JavaScript with the same information now living in the comment; turn it off to keep the TypeScript untouched and just add documentation on top. "Generate @typedef for interfaces" turns an `interface` or an object `type` into a typedef block; "Add @template for generics" documents type parameters like `<T>`; "Add @throws from throw statements" scans each function body for `throw new SomeError(...)` and lists the distinct error types found. Comment style switches between the conventional aligned-star block and a tighter one-line-open variant, and line width controls where a long line wraps.
The tool reads top-level function declarations, arrow functions assigned to a `const` or `let`, interfaces and object-shaped type aliases — the declarations JSDoc has a tag for. Type annotations on local variables inside a function body, and methods defined inside a class or an object literal, are left as written; rewriting every type in a file safely needs a full compiler, and this stays a small, fast script that runs the moment you stop typing.
Everything runs locally in your browser — your code is never uploaded, so pasting from a private project is safe. Copy the result, download it as a .txt file, or send the output straight back into the input to run another tool on it next.