Developer Tools
JSDoc Comment Generator
Paste a JS or TS function signature and generate a JSDoc block with @param, @returns, @throws, and @example tags. Works for arrows, classes, and TypeScript.
Paste a JavaScript or TypeScript function. The parser handles function declarations, arrow functions, class methods, constructors, async, generators, rest params, destructured params, and TypeScript types.
What the parser detected
name "fetchUser", 2 params, async, TypeScript, returns Promise<User>
Param 1
id
type string, required
Param 2
opts
type FetchOptions, optional
JSDoc tags to include
Pick the tags that should appear in the generated comment block.
Visibility
Add an access modifier tag. TypeScript users often skip this because the language enforces it directly.
How to use
- Paste a function or method signature into the input area. Click any sample to try a plain JS function, a TypeScript async function, an arrow function, a class method, a constructor, or rest parameters.
- Read the What the parser detected panel to confirm the name, parameter list, async or generator flag, and return type the parser picked up.
- Toggle the tags you want: summary line, @param, @returns, @throws, @example, @deprecated, @since, @author, @see. Provide custom values for @since, @author, and @see when those are turned on.
- Pick a visibility tag (@public, @private, @protected) only if your style guide needs one. TypeScript users often leave this off.
- Enable TypeScript-aware tags to skip the {type} prefix when the source already has TS annotations, and align dashes for a tidy multi-param block.
- Choose whether to output only the JSDoc comment or the comment followed by your original signature, then click Copy output to paste it into your editor.
About this tool
JSDoc Comment Generator reads a JavaScript or TypeScript function signature and writes a properly formatted JSDoc block above it, ready to paste into your editor for IntelliSense, TypeDoc, jsdoc.app HTML output, or any tool that consumes the JSDoc standard. The parser handles the signatures real codebases use every day: function declarations, async functions, generator functions, default and named exports, arrow functions assigned to const, let, or var, class methods, class arrow-property fields, constructors, and bare arrow expressions. Inside the parameter list it correctly tracks default values like count = 0, rest parameters with the spread operator, object and array destructure patterns including nested shapes, optional params marked with a trailing ?, and full TypeScript type annotations on each parameter and on the return position, so a signature like fetchUser(id: string, opts?: FetchOptions): Promise<User> is recognized end to end. The output block follows the JSDoc convention every editor reads: a summary line at the top, a blank separator line, then @param tags (one per parameter, with the brace-wrapped type, the parameter name, optional brackets and default value when applicable, and a placeholder description), an @returns tag with the inferred return type (Promise<*> for async functions when no annotation exists), and any other tags you opt into: @throws, @example with an auto-generated call sample, @deprecated, @since with your own version string, @author with your name, @see with a cross-reference URL, and one of @public, @private, or @protected for visibility. A TypeScript-aware toggle skips the redundant {type} prefix on @param and @returns lines when the source signature already carries TypeScript annotations, matching the style modern TS docblocks use. An align-dashes toggle pads the @param block so the trailing dashes line up in a tidy column. Indentation is preserved from the source so the generated block sits cleanly above an indented class method. The detection panel surfaces what the parser found so you can verify the function name, parameter list, async or generator flag, and return type at a glance. Everything runs locally in your browser. The signature you paste, the parameter list, the tag values, and the resulting JSDoc block never leave your device. Useful for documenting new APIs, retroactively annotating a JavaScript codebase, generating docblocks for shared utilities, preparing functions for TypeDoc or jsdoc.app, and writing IntelliSense-friendly hover help that anyone calling your function will see in their editor.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Changelog Generator
Parse git commits, group by Conventional Commits type, and render Markdown release notes.
Open tool
DeveloperConventional Commits Builder
Generate semantic git commit messages with type, scope, body, breaking change, and footers.
Open tool
DeveloperTypeScript Utility Types Reference
Searchable catalog of every built-in TypeScript utility type with examples and use cases.
Open tool
DeveloperMarkdown Cheat Sheet
Searchable Markdown syntax reference with rendered previews and flavor filters.
Open tool
DeveloperJavaScript Formatter
Beautify minified or dense JavaScript with configurable indent, quotes, and semicolons.
Open tool
DeveloperTSConfig Generator
Preset-driven tsconfig.json builder with strictness, paths, and emit toggles.
Open tool