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

|
3 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 while preserving blank lines where they originally existed.

Supports:

  • C-style comments: // single-line and /* multi-line */
  • Python-style comments: # single-line, ''' multi-line ''', and """ multi-line """


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.
  • Preserves original blank lines for readability.
  • Works with multiple languages (C, C++, Java, JavaScript, Python, etc.).
  • Can be triggered from:
    • Command Palette
    • Custom keyboard shortcut

Supported Languages

Currently works with languages that use:

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

Example:

Python:

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