Alternatively called Cmd+W, Command+W is a keyboard shortcut often used to close a program, window, tab, or document.

How to use the Command+W keyboard shortcut

To use this keyboard shortcut, press and hold either Command key, and while continuing to hold, press W.

  • How to use the Command+W keyboard shortcut.
  • Command+W in macOS.
  • Command+W in an Internet browser.
  • Command+W in Excel.
  • Command+W in Microsoft PowerPoint.
  • Command+W in Word and other word processors.
  • Related keyboard shortcuts and keys.
  • Related information.
  • Computer keyboard shortcuts.

Command+W in macOS

In Apple’s macOS, pressing Command+W closes the current program.

Command+W in an Internet browser

In all major Internet browsers (e.g., Chrome, Edge, Firefox, Opera, Safari), pressing Command+W closes the current tab. If there aren’t multiple tabs open, pressing Command+W closes the browser.

  • Firefox shortcuts
  • Google Chrome shortcuts

Command+W in Excel

In Microsoft Excel and other spreadsheet programs, pressing Command+W closes the current workbook.

  • Full list of Excel shortcuts.

Command+W in Microsoft PowerPoint

In Microsoft PowerPoint, the Command+W keyboard shortcut closes the current presentation.

If you’re editing the contents of a cell and press Command+W, nothing will happen.

  • Full list of PowerPoint shortcuts.

Command+W in Word and other word processors

In Microsoft Word and other word processors, pressing Command+W closes the current document.

  • Full list of Microsoft Word shortcuts.

Below are links to related keyboard shortcuts and individual key pages.

  • Command

Close, Cmd, Keyboard shortcut, Keyboard terms, W

  • Computer keyboard shortcuts.
  • Top 10 keyboard shortcuts everyone should know.
  • Keyboard help and support.