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

Continue with VS Code Shortcuts

Save the full cheat sheet or work through every related task.

More VS Code tasks

Back to the full VS Code Shortcuts cheat sheet