The fastest keyboard shortcut to shut down your computer
On Windows, press Alt + F4 while you are on the desktop (not inside an open program). A shutdown dialog box will appear. Press the down arrow key once to highlight "Shut down," then press Enter. Your computer will close all programs and power off.
On Mac, press Control + Command + Power button (or Control + Command + Eject on older keyboards). A dialog box will ask if you want to shut down, restart, or sleep. Press Enter to shut down, or use the arrow keys to select a different option first.
On Linux, the keyboard method depends on your desktop environment. In most setups, press Alt + F2, type shutdown -h now, and press Enter. Some systems use Super key + S (the Windows key or Command key) to open a power menu instead.
Key Takeaways
- Windows users can shut down with Alt + F4 from the desktop, then arrow down to "Shut down" and press Enter.
- Mac users press Control + Command + Power button, then press Enter to confirm shutdown.
- Linux shutdown varies by desktop environment but often uses Alt + F2 followed by typing a shutdown command.
- If a program is frozen and blocking shutdown, force-close it first with Alt + F4 or Task Manager before shutting down the system.
What to do if Alt + F4 does not work on Windows
Alt + F4 only works when you are on the desktop or in a window that recognizes the command. If you are inside a full-screen game or process, Alt + F4 may close only that program, not your computer.
If Alt + F4 does not open a shutdown dialog, try opening the Start menu instead. Press the Windows key, then press the right arrow key to navigate to the power button icon (usually at the bottom right of the Start menu). Press Enter, then use arrow keys to select "Shut down."
Another option is to use the Run dialog. Press Windows key + R, type shutdown /s /t 0, and press Enter. The /s command shuts down, and /t 0 means it happens when ready with no delay.
Shutting down when your mouse is not working
If your mouse has stopped responding, keyboard shortcuts are your only way to shut down cleanly. The methods listed above all work without a mouse.
On Windows, the Windows key + X combination opens a power menu that you can navigate with arrow keys. Press Windows key + X, then press U twice (once for the shutdown submenu, once to select shutdown). Your computer will shut down after a short countdown.
If you need to shut down when ready without any delay, the Run dialog method (Windows key + R, then shutdown /s /t 0) is the most direct route and requires no menu navigation.
Forcing a shutdown when programs are frozen
If your computer is not responding to normal shutdown commands, you may have a frozen program blocking the process. Press Alt + Tab to cycle through open windows and find which program is stuck. Once you see it, press Alt + F4 to close it.
If Alt + Tab and Alt + F4 do not work, open Task Manager on Windows by pressing Ctrl + Shift + Esc. Use the arrow keys to navigate to the frozen program, press Delete, and select "End task." Once the problem program is closed, you can shut down normally.
On Mac, press Command + Option + Esc to open the Force Quit dialog. Use arrow keys to select the frozen program and press the "Force Quit" button (you may need to press Tab to reach it, then Enter to set up it).
Scheduling a shutdown for a specific time
On Windows, you can set your computer to shut down at a time you choose without touching it again. Press Windows key + R, type shutdown /s /t 3600 (where 3600 is the number of seconds to wait), and press Enter. For example, 3600 seconds equals one hour. To shut down in 30 minutes, use 1800.
If you change your mind before the shutdown happens, press Windows key + R again, type shutdown /a, and press Enter. This cancels the scheduled shutdown.
Mac and Linux do not have built-in keyboard shortcuts for scheduled shutdown, but you can open the Terminal process and type sudo shutdown -h +60 (where 60 is minutes from now) and press Enter. You will be asked for your password.
Restarting instead of shutting down
If you need to restart rather than shut down, the process is almost identical. On Windows, press Alt + F4 from the desktop, use arrow keys to select "Restart," and press Enter.
On Mac, press Control + Command + Power button, use arrow keys to select "Restart," and press Enter.
You can also use the Run dialog on Windows: press Windows key + R, type shutdown /r /t 0, and press Enter. The /r command restarts instead of shutting down.
Frequently Asked Questions
Can I shut down my computer with just one keyboard combination?
Not on most systems. Windows and Mac require you to press a combination, wait for a dialog, then press additional keys to confirm. The Run dialog method on Windows (Windows key + R, then shutdown /s /t 0) is the closest to a single action, but it is technically two steps.
What happens to unsaved work when I shut down with the keyboard?
Most programs will prompt you to save before closing. If you use Alt + F4 or the normal shutdown menu, Windows and Mac give programs a chance to ask. If you use the when ready shutdown command (shutdown /s /t 0), programs close without prompting, and unsaved work is lost.
Is it safe to shut down with the keyboard instead of the power button?
Yes. Keyboard shutdown is the normal, safe way to turn off your computer. It lets the operating system close programs and files properly. Using the power button should only be a last resort if the keyboard method does not work.
Why does Alt + F4 sometimes close my program instead of shutting down?
Alt + F4 closes whatever window is currently active. If you are inside a program when you press it, that program closes first. Make sure you are on the desktop (no windows open) before pressing Alt + F4 to shut down the whole computer.