The close shortcut key in Windows is Alt + F4: it closes the program or window in front. If the file has unsaved changes, the program asks whether to save first. To close only one browser tab or one document and keep the program open, press Ctrl + W instead.
On many laptops F4 also mutes the microphone or changes a setting, so the laptop close shortcut key becomes Fn + Alt + F4. On the empty desktop, Alt + F4 opens the shut down box rather than closing anything.
Quick facts
Close program
Alt + F4Close tab or document
Ctrl + WClose browser window
Ctrl + Shift + WLaptop
Fn + Alt + F4Close a dialog
EscMac
Command + Q or Command + W
Close shortcut key options
| Keys | Closes | Program stays open? |
|---|---|---|
| Alt + F4 | The whole program window | No |
| Ctrl + W | The current tab or document | Yes |
| Ctrl + F4 | The current document in some programs | Yes |
| Ctrl + Shift + W | The whole browser window with all its tabs | No |
| Esc | A dialog box or menu | Yes |
Alt + F4 shortcut key is used for
Alt + F4 is used for closing the active program, the same as clicking the X at the top right. Pressed repeatedly, it closes one program after another. With nothing open and the desktop selected, it opens the Shut Down Windows box instead, which is why the shutdown shortcut key guide starts with Win + D.
Close all windows shortcut
Windows has no single key that closes every program. To clear the screen quickly without closing, press Win + D or Win + M; see the minimize shortcut key. To close several programs, press Alt + F4 once for each, saving files as prompted. Shutting down or restarting also closes everything in one go.
Exit shortcut key and Ctrl + Q
Some programs use Ctrl + Q to quit, but it is not universal. In Word, Ctrl + Q removes paragraph formatting instead, and in many Windows apps it does nothing. Stick to Alt + F4 on Windows. In Chrome and Edge, Ctrl + Shift + W closes the current window, and Ctrl + Shift + T reopens a tab closed by mistake; see the close tab shortcut.
When the close keys do not work
| Problem | Fix |
|---|---|
| Alt + F4 mutes the mic | Use Fn + Alt + F4 |
| Program will not close | It has frozen; use Ctrl + Shift + Esc and End task |
| Shut down box appears | The desktop was active; press Esc |
| Full screen game ignores it | Some games block it; use the game's own exit menu |
Frozen programs are covered in the Task Manager shortcut guide.
Close on a Mac
On a Mac, Command + W closes the front window or tab, and Command + Q quits the whole app. Option + Command + W closes all windows of the app. Clicking the red button only closes the window; the app may keep running, shown by a dot under its Dock icon.
Frequently asked questions
What is the close shortcut key in Windows?
What is the shortcut key to close a window on a laptop?
What is Alt + F4 used for?
Closing the active program, or opening the shut down box from the desktop.
Is there a shortcut to close all windows?
No single key. Press Alt + F4 for each program, or shut down.
What does Ctrl + Q do?
It quits some programs, but in Word it removes paragraph formatting.