The quickest shortcut to exit a window in Windows is Alt+F4 on a PC, or Command+W on a Mac. Pressing Alt+F4 closes the active window immediately; if no window is active, it opens the Shut Down Windows dialog. On a Mac, Command+W closes the current window, and Command+Q quits the entire application.
Why Alt+F4 Is the Default Window Closer
Alt+F4 has been the universal “close window” shortcut in Windows since the early 1990s. It sends a close command to the active window, which is the same as clicking the X button in the top-right corner. The key combination works across nearly all desktop applications, including web browsers, file explorers, and office programs. It even closes the Start menu if it’s open, and on the desktop it triggers the shutdown dialog.
Unlike Ctrl+W, which only closes a tab in a browser, Alt+F4 closes the entire window and all its tabs. For example, if you have five tabs open in Chrome, Alt+F4 will close the whole browser window, while Ctrl+W closes just the active tab. This distinction is important when you want to exit an application completely rather than just dismiss a single document or tab.
Other Keyboard Shortcuts That Close Windows
Several other shortcuts can close windows or applications, depending on the context:
- Ctrl+W – Closes the current tab or document in most browsers and editors (e.g., Notepad, Word). It does not close the application itself.
- Ctrl+F4 – Closes the active document window inside an application that supports multiple windows (e.g., Excel, Word). In Excel, Ctrl+F4 closes the workbook, not the Excel program.
- Windows key + Down arrow – Minimizes the current window (not exactly closing, but useful for getting it out of the way).
- Alt+Spacebar, then C – Opens the window’s system menu and selects Close. This is a fallback if Alt+F4 is blocked by a game or a remote desktop session.
- Command+W / Command+Q (Mac) – Close window / quit app. Command+Shift+W closes all windows of the current app.
What to Do When Alt+F4 Doesn’t Work
Sometimes Alt+F4 appears to do nothing. Common reasons include:
- The window is not active – click on it first, then press Alt+F4.
- A dialog box inside the window is open – close that dialog first.
- The application has a custom shortcut that overrides Alt+F4 (e.g., some games).
- You are in a remote desktop session and the shortcut is being captured by the local machine.
If Alt+F4 is unresponsive, try Ctrl+Shift+Esc to open Task Manager, select the app, and click “End task.” This forces the window to close, but you may lose unsaved work. Alternatively, use the system menu: press Alt+Spacebar, then press C (or click Close).
Exiting Full-Screen or Kiosk Mode
In full-screen applications like games, video players, or presentation modes, Alt+F4 usually still works, but sometimes it’s disabled. The universal escape key is F11 in browsers to toggle full-screen. In games, try Alt+Tab to switch to another window, then close the game from the taskbar. For a stuck full-screen app, press Ctrl+Alt+Delete and choose Task Manager – this always works because it’s a system-level interrupt.
How to Change or Create Your Own Close Shortcut
Windows doesn’t let you remap Alt+F4 directly, but you can create a custom shortcut for closing windows using AutoHotkey (a free scripting tool). For example, you could map Ctrl+Alt+Q to send Alt+F4. Here’s a simple script:
^!q::Send !{F4}
Save it as a .ahk file, run it, and Ctrl+Alt+Q will close the active window. On a Mac, you can change shortcuts in System Settings > Keyboard > Keyboard Shortcuts, but the close window shortcut is usually fixed.
Closing Windows Without a Keyboard
If you prefer mouse-only methods, the X button is the obvious choice. But you can also right-click the taskbar icon of an open app and choose “Close window” (Windows 10/11). On a Mac, right-click the dock icon and select Quit. For touchscreens, swipe down from the top of the window in tablet mode to close it.
Frequently Asked Questions
Does Alt+F4 close the whole app or just one window? It closes the active window. If an app has multiple windows (like Word with two documents), Alt+F4 closes only the active one. If the app has no other windows, the app quits.
What’s the difference between Alt+F4 and Ctrl+W? Alt+F4 closes the entire window and quits the application if it’s the last window. Ctrl+W closes only the current tab or document, leaving the app running.
Why does Alt+F4 sometimes open the shutdown dialog? When no window is active (e.g., you’re on the desktop), Alt+F4 triggers the Windows shutdown menu. This is by design; press Enter to shut down or Esc to cancel.
Is there a shortcut to close a window in a browser without using the mouse? Yes, Ctrl+W closes the current tab, and Ctrl+Shift+W closes the entire browser window in Chrome, Edge, and Firefox.
Can I close a window that is not responding? Alt+F4 may not work if the app is frozen. Use Ctrl+Shift+Esc to open Task Manager, select the app, and click End task. You’ll lose unsaved changes.
Does Alt+F4 work on Mac? No, Alt+F4 is a Windows shortcut. On Mac, use Command+W to close a window and Command+Q to quit the app.
Related
- How to Generate Random Numbers on a Calculator
- Maximum Data Entry: Definition, Limits, and Real Usage
- Number Shortcut Keys: Full List & How to Use Them
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Won’t Group Dates in a PivotTable? Fixes That WorkIf Excel won’t group dates in a PivotTable, first check that every cell in the source date column…
- Excel Merge Cells Without Merging: Better AlternativesTo make cells look merged without actually merging them in Excel, select the range, open Format Cells with…
- Does Google Sheets Have VLOOKUP? How to Use ItYes. Google Sheets has the VLOOKUP function, which searches down the first column of a range and returns…
- Select All in Google Sheets: Shortcuts and OptionsTo select all cells in a Google Sheets tab, click the blank square at the top-left corner of…
- Create Rules in Personal Outlook: Step-by-Step GuideCreate a rule in personal Outlook by opening Settings > Mail > Rules in Outlook.com or new Outlook,…
- How to Insert a New Column in Excel: Steps and TipsTo insert a new column in Excel for Microsoft 365 on Windows, click the letter at the top…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.