Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Code Comments RemoverNew to Visual Studio Code? Get it now.
Code Comments Remover

Code Comments Remover

Abhishek Chaurasia

|
10 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove Comments

A simple Visual Studio Code extension to remove all comments from the current file or only from the selected portion of code.
Blank lines where comments existed are preserved for readability.


Keyboard Shortcut

Default: Ctrl + Alt + W (Windows/Linux)

To change it:

  1. Open File → Preferences → Keyboard Shortcuts (or press Ctrl+K Ctrl+S).
  2. Search for remove-comments.run.
  3. Click the pencil icon and set your preferred keybinding.

Features

  • Removes inline and block comments.
  • Works on:
    • Whole file (if no selection).
    • Selected portion only (if code is highlighted).
    • Multiple selections are also supported.
  • Preserves original blank lines for readability.
  • Supports multiple languages (C, C++, Java, JavaScript, Python, etc.).
  • Can be triggered from:
    • Keyboard shortcut
    • Command Palette (Ctrl+Shift+P → “Remove Comments”)

Supported Languages

Currently works with languages that use:

  • // ...
  • /* ... */
  • # ...
  • ''' ... '''
  • """ ... """

Examples

Python

# This is a comment
x = 5  # Inline comment
"""
This is
a multi-line comment
"""
print(x)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft