Software & OS

How to Turn Off Computer With Keyboard (Windows and Mac)

To turn off a computer with the keyboard on Windows 11, close or minimize your windows, press Alt+F4 on the desktop and press Enter at the shutdown prompt. If that prompt does not appear, press the Windows logo key + X, then U, then U, or run shutdown /s /t 0.

Windows does not have one official, dedicated shutdown shortcut. Microsoft's keyboard shortcut list contains no entry named "shut down". What you have instead is a handful of ways to reach the same result without touching the mouse. This article covers each one, says when it fails, and ends with the Mac equivalents.

Quick answer: which keys to press

MethodKeysWorks onCaveat
Alt+F4 on the desktopAlt+F4, then EnterWindows 11Only when no window is open
Quick Link menuWin+X, U, UWindows 10 and 11, English menusLetters depend on the display language
Command lineshutdown /s /t 0Windows 10 and 11Closes apps without asking when the timeout is above 0
Mac power dialogControl+Power buttonmacOS, Macs without Touch IDThen choose Shut Down

Shut down with Alt+F4

Alt+F4 normally closes the window you are in. Microsoft's shortcut table for Windows 11 describes it as "Close the active window. If no windows are open, prompt to shutdown." So the trick is to get to an empty desktop first:

  1. Press the Windows logo key + D to show the desktop, or close your apps one by one with Alt+F4.
  2. When nothing is open, press Alt+F4 once more. The Shut Down Windows box appears.
  3. Use the arrow keys to pick Shut down in the list and press Enter.

Be careful with the middle step. If a document is still open and you press Alt+F4 repeatedly, you will be asked whether to save it. Read the prompt before pressing Enter, because Enter might accept a choice you did not intend.

Microsoft's Windows 10 table words the same shortcut differently: "Close the active item, or exit the active app." It does not mention a shutdown prompt there. Many Windows 10 machines still show the box on an empty desktop, but that is not something Microsoft's list promises, so treat the Windows 11 behavior as the documented one.

Shut down with the Win+X menu

The Windows logo key + X opens the Quick Link menu. Microsoft's list says it matches right-clicking the Start button. That menu has a "Shut down or sign out" entry, and each entry has an underlined letter you can press to select it.

  1. Press Win+X.
  2. Press U to open the "Shut down or sign out" submenu.
  3. Press U again to choose Shut down.

Press the keys one after another, not together. The same menu has R for Restart under the same submenu, so Win+X, U, R restarts. Microsoft's shortcut page does not document these underlined-letter sequences. The sequence appears in a Microsoft Q&A community post, and it depends on the underlined letters in an English-language menu. If your display language is not English, open the menu with Win+X and read which letter is underlined, or move with the arrow keys and press Enter.

Some users on Microsoft's forums report that the letter shortcuts in this menu stop responding after an update, with the menu opening but the second key doing nothing. If that happens to you, the arrow keys still work.

Shut down from Run or the command line

The shutdown command is documented by Microsoft and is the most predictable method, because it behaves the same whatever your language or Windows version. Press the Windows logo key + R to open Run, type the command, and press Enter:

shutdown /s /t 0

This shuts the computer down with a zero-second timeout. Without /t, the default timeout is 30 seconds, and Windows shows a warning during that time. Microsoft also notes that if the timeout is greater than 0, the /f switch is implied, which forces running applications to close without warning and can lose unsaved data. With /t 0 that implication does not apply, but save your work anyway.

These switches are the useful ones, as listed on Microsoft Learn:

SwitchWhat it does
/sShuts down the computer
/rRestarts the computer after shutdown
/t <seconds>Sets the timeout before shutdown; valid range 0 to 315360000, default 30
/hybridShuts down and prepares for fast startup; must be used with /s
/hHibernates the local computer, if hibernation is enabled
/aAborts a pending shutdown, during the timeout only
/fForces running applications to close without warning

To schedule a shutdown ten minutes from now, run shutdown /s /t 600. To cancel it, open a new Command Prompt or PowerShell window and run:

shutdown /a

You need the right to shut down the system for the command to work. On a normal home or work PC that right is already yours. On a locked-down work machine it may be restricted by policy.

What about Ctrl+Alt+Delete?

Ctrl+Alt+Delete is often suggested for this job. Microsoft's Windows 11 table describes it as switching to the security screen, where you can lock the desktop, sign out or open Task Manager. I could not confirm a shutdown option from Microsoft's documentation, so this article does not rely on it. Use it to reach Task Manager if the system seems stuck.

Shut down a frozen computer

Shortcuts that open menus need Windows to be responsive. If the screen is frozen and the keyboard does nothing, no shortcut will shut the machine down cleanly. The last resort is to hold the physical power button until the machine switches off. That is a forced power-off: unsaved work is lost and open files can be left in an inconsistent state, so use it only when nothing else responds. If shutdowns keep ending that way or the machine switches off by itself, see why a computer keeps shutting down.

How to turn off a Mac with the keyboard

Apple's keyboard shortcut list includes these power-button combinations. Apple lists them as shortcuts for Macs without Touch ID, so check Apple's page for how your model's power button behaves.

  • Control+Power button: shows a dialog asking whether you want to restart, sleep or shut down. Choose Shut Down with Tab or the arrow keys and press Return.
  • Control+Option+Command+Power button: quits all apps, then shuts down the Mac.
  • Control+Command+Power button: forces the Mac to restart without prompting to save open documents. Avoid it unless the Mac is stuck.

Note that Control+Command+Q locks the screen on a Mac, so it does not shut anything down despite the Q. For other everyday shortcuts on both systems, see essential Windows and Mac hotkeys. If you only need the Windows Settings app and not a shutdown, opening Windows Settings has its own list of keys.

Shutdown vs restart vs Fast Startup

On Windows, a shutdown from the Start menu can be a "hybrid" shutdown when Fast Startup is on. The /hybrid switch, which Microsoft describes as preparing the device for fast startup, exists for that reason. If you want a full shutdown, for example to apply a driver change that only takes effect after a cold start, a restart is the usual way to get one: shutdown /r /t 0. Holding Shift while clicking Shut down is a common tip for skipping Fast Startup once, but I did not find it in Microsoft's documentation, so test it before relying on it.

If the shortcut does nothing

  • Alt+F4 only closes windows: a window still has focus. Press Win+D and try again.
  • Win+X letters do nothing: open the menu and use the arrow keys, or switch to the shutdown command.

Frequently asked questions

What is the keyboard shortcut to shut down Windows?
Windows has no single dedicated shutdown shortcut. On Windows 11, minimize or close every window and press Alt+F4 on the desktop to get the shutdown prompt, then press Enter. Another route is Windows logo key + X, then U, then U, which works on English-language systems. The command shutdown /s /t 0 also shuts down immediately.
How do I turn off a laptop with the keyboard when the screen is frozen?
If Windows no longer responds to shortcuts, the keyboard cannot shut it down cleanly. Hold the physical power button until the laptop switches off, which is a forced shutdown and can lose unsaved work. Try Ctrl+Shift+Esc first to see whether Task Manager opens and the system is only busy.
Does Alt+F4 shut down my computer?
Only when no windows are open. Microsoft's Windows 11 shortcut list says Alt+F4 closes the active window, and if no windows are open it prompts to shut down. With a window in focus, Alt+F4 closes that window and nothing else.
How do I cancel a shutdown I started from the command line?
Run shutdown /a in a new Command Prompt or PowerShell window before the time-out ends. Microsoft documents /a as aborting a pending system shutdown, and it only works during the time-out period.

Sources