You can also use keyboard shortcuts to restart, hibernate, and put your PC to sleep. Whether your mouse is glitchy or your trackpad is having a moment, the few seconds you can save will come in handy when speed is important.

This article will show you how to restart a computer with a keyboard and how to put your computer to sleep with keyboard shortcuts. We’ll also share custom methods for shutdown, restart, and sleep commands, giving you more options and control.

How to Shut Down, Restart, or Put Windows PC to Sleep with a Keyboard

Use the Alt + F4 Combo (The Shut Down Windows Dialog)

Pressing the Alt + F4 keyboard hotkey closes any open program just like clicking the X button in the top-right corner of a window. However, the same keyboard shortcut will produce the Shut Down Windows dialog when you’re on your desktop environment or don’t have any active windows open.

You can press the Alt + F4 hotkey simultaneously until all your windows are closed and you see the Shut Down dialog. You could also press Win + D to go to your desktop, then tap the Alt + F4 shortcut.

After the Shut Down Windows dialog opens, select the action you want to execute (you can use your arrow keys), and hit the Enter button.

Windows 11 shut down

That’s how to turn off your computer with your keyboard. You can move on to the next method if you want more options or don’t fancy the Alt + F4 combo.

Use the Power User Shortcut

This method shows you how to put your computer to sleep or restart or shut it down using a few key sequences.

Pressing the Windows and X keyboard buttons simultaneously summons the Power User Menu, which appears on top of the Windows logo in your taskbar. 

shut down or sign out Windows 11

Once the menu appears, you can press a sequence of keys to choose a power action.

Here’s how:

  1. Press Win + X.
  2. Tap the U button on your keyboard after you see the Power User Menu.
  3. The “Shut down or sign out” submenu will now expand.
  4. Use the following keys to choose your option:

H –Hibernate

I – Sign out

R – Restart

S – Sleep

U – Shut down the computer

Windows 11 sign out
PRO TIP
You need to enable your computer’s hibernate option if you do not see it in the power menu. Our guide on how to disable and enable hibernation on Windows 10/11 will show you what to do.

Related: How to Fix Sleep Option Missing in Windows 10 and 11?


Creating Your Own Keyboard Shortcut

Making your own sleep, shutdown, and restart shortcuts is a cool trick that allows you to pick a custom keyboard combination to trigger your desired actions.

The process starts with creating a shortcut that executes the command. After that, you can assign a custom keyboard combo to launch the shortcut.

Follow these steps to create a new shortcut:

  • Go to your desktop interface and right-click an empty spot.
  • Select New > Shortcut.
New Shortcut Windows 11
  • Once the Create Shortcut dialog appears, go to the text box under “Type the location of the item” and enter one of the following:

shutdown /s (to shut down Windows without force-quitting your apps)

What item would you like to create a shortcut for
PRO TIP
Your computer may not shut down until you close some applications. You can follow our guide on how to force quit unresponsive apps if some applications are frozen.
  • shutdown.exe -s -t 00 -f(to shut down Windows and forcibly close any open app)
  • shutdown /r /f /t 0 (shortcut to restart computer – forcibly close apps, shut down Windows, and then restarts the computer)
  • rundll32.exe powrprof.dll,SetSuspendState 0,1,0 (shortcut to put computer to sleep)

Each command should go for each shortcut you want to create.

The sleep shortcut will hibernate your computer if the hibernate option is activated. You must disable hibernation if you want the shortcut to put your computer to sleep.

Click Next and type a name to identify the shortcut. You can use Restart for the restart shortcut and Shutdown for the shortcut that shuts down the computer.

shutdownexe
  • Click Finish.

Follow these steps to assign a keyboard combination to the shortcut:

  • Right-click the shortcut you just created and select Properties.
Windows 11 Properties
  • Go to the Shortcut key text box when the Shortcut tab of the Properties dialog appears.
  • Tap the keyboard combination you want to use.

The keyboard combination will start with CTRL + ALT if you only press the CTRL key and another key simultaneously. You can replace the ALT key with SHIFT by pressing the CTRL, SHIFT, and another key together. 

  • Click the OK button.
shutdownexe properties

Ensure you pick a shortcut that isn’t already in use by Windows or other programs to avoid conflicts. For example, the CTRL + Shift + C shortcut helps you check word counts when typing in Google Docs. You don’t want to accidentally shut down your system when you hit that combination.

Use Your Dedicated Sleep Button

Some computers and keyboards provide dedicated sleep buttons that allow users to put their PCs to sleep with just a single tap.

The key may have a Zz icon and may be stand-alone or integrated into a function key. If it’s attached to a function key, you may have to press and hold the Fn key before tapping it.

Note that it’s fine if your computer doesn’t have a dedicated sleep key. You can convert your power button.

Pro Tip: Making Your Power Button Your Dedicated Sleep Button

While this method doesn’t involve using your keyboard, it’s one of the fastest ways to knock your PC out.

Depending on your computer’s factory settings, pressing your power button should initiate the shutdown process. In some cases, it will only lock your computer or sign you out. If you don’t need these functionalities, you can make the power button more useful.

Follow these steps:

  • Launch the Start menu using the Windows button on your keyboard.
  • Search for and launch Control Panel.
  • Click Hardware and Sound.
Hardware and sound
  • After the Hardware and Sound window appears, go to the Power Options section and click “Change what the power buttons do.”
change what power buttons do
  • On the next page, select Sleep next to When I press the power button.” If you use a laptop, you can choose the Sleep option in the On battery and Plugged in menus. You can also choose the Sleep option next toWhen I close the lid.”
define power buttons Windows 11
PRO TIP
To make your experience better always keep in mind these helpful keyboard shortcuts: 

Press Ctrl + Shift + Esc shortcut to open the Task Manager directly and to manage running processes and troubleshoot performance issues efficiently.

Press Alt + Tab shortcut to switch between open windows and applications and to make it easy to navigate multiple tasks simultaneously.

Conclusion

That’s how to shut down and put your computer to sleep without swipes and clicks. The methods above also show you how to restart a laptop with a keyboard. You can now perform these actions faster without reaching for your mouse or trackpad.

Share your experience with these shortcuts with us in the comments section below.

FAQ

You can wake your laptop from sleep by pressing any key on the keyboard.
You should consider turning off your keyboard’s game mode if it has one. You can also activate sticky keys or troubleshoot the keyboard.
You can force restart a PC by pressing and holding the power button until the computer goes off, and then tapping the power button again to restart it.