Toggle Line Comment in VS Code

From the VS Code Shortcuts cheat sheet Ā· Editing Ā· verified Jul 2026

Toggle Line Comment

Comment/uncomment current line or selection

text
Ctrl+/ (Windows)
⌘+/ (Mac)
šŸ’” Language-aware commenting
⚔ Works with multiple line selections
šŸ” Automatically detects comment syntax
commenting

More VS Code tasks

Back to the full VS Code Shortcuts cheat sheet