Why Your Computer Stays Awake and How to Find the Cause
A computer that refuses to sleep is usually being kept awake by a device, a program, or a setting that tells the operating system to stay active. The most common culprits are a mouse or keyboard that detects movement, a network device like a printer or external drive, a program running in the background, or a power setting that overrides sleep mode entirely. Before you change anything, you need to know which one is responsible — otherwise you will fix the wrong thing and the problem will return.
Windows and Mac both have built-in tools that show you what is preventing sleep. On Windows, you can run a command that lists every device and program blocking the system. On Mac, the log files tell you the same thing. Once you know the cause, the fix is usually straightforward: disable the device, close the program, or change one setting.
Key Takeaways
- Windows has a command-line tool that shows exactly which devices or programs are keeping your computer awake, and you do not need to guess.
- Mice, keyboards, network devices, and USB drives can all prevent sleep if they are set to wake the computer, and you can disable this in Device Manager.
- Background programs like antivirus software, cloud sync tools, and media servers often block sleep, and closing them or changing their settings stops the problem.
- Power settings in Control Panel or System Preferences can override sleep mode entirely, so check that sleep is actually enabled and set to a time that makes sense for your use.
- Once you fix the cause, test sleep mode by closing all programs and pressing the sleep button or waiting for the timeout to confirm it works.
Find What Is Blocking Sleep on Windows
Open Command Prompt as an administrator. Right-click the Start button, select "Windows Terminal (Admin)" or "Command Prompt (Admin)", and wait for the window to open. Type this command exactly: powercfg /lastwake and press Enter. This shows you the last device that woke your computer.
For a full list of everything currently preventing sleep, type: powercfg /requests and press Enter. The output will show you the name of each device or program and why it is blocking sleep. Look for entries marked "System" or "Display" — these are the ones actively preventing your computer from sleeping. Write down the exact names so you can find them in the next steps.
If the list is long or confusing, focus on the devices and programs you recognize. A printer driver, a network adapter, or a program like Spotify or OneDrive is more likely to be the problem than something with a generic Windows name.
Stop Devices from Waking or Blocking Sleep
Many devices — mice, keyboards, network adapters, USB hubs — have a setting that lets them wake the computer from sleep. This is useful if you want to wake your computer by moving the mouse, but it also prevents sleep in the first place. Open Device Manager by right-clicking the Start button and selecting "Device Manager".
Find the device in the list. Look under "Mice and other pointing devices" for your mouse, "Keyboards" for your keyboard, or "Network adapters" for your network card. Right-click the device, select "Properties", and go to the "Power Management" tab. Uncheck the box that says "Allow this device to wake the computer". Click OK and repeat for any other devices that showed up in the powercfg output.
After you change these settings, restart your computer and test sleep mode again. If the problem was a device, it should now sleep normally.
Close or Reconfigure Background Programs
Programs running in the background often block sleep without you knowing they are there. Antivirus software, cloud storage tools like OneDrive or Google Drive, media servers, and remote desktop software are common offenders. Open Task Manager by pressing Ctrl+Shift+Esc, and look at the "Processes" tab. You will see every program currently running.
Look for programs you recognize that might need to stay active — antivirus software, backup tools, or cloud sync programs. Right-click each one and select "End task" to close it temporarily. Then try to sleep your computer. If it sleeps successfully, that program was the problem. To fix it permanently, open the program's settings and look for an option to allow sleep mode or disable wake timers. Most modern programs have this option buried in "Preferences" or "Advanced Settings".
If you cannot find the setting in the program itself, you can prevent it from running at startup. Open Task Manager, go to the "Startup" tab, right-click the program, and select "Disable". The program will no longer start automatically, though you can still open it manually when you need it.
Check and Adjust Power Settings
Your computer might be set to never sleep, or sleep might be disabled entirely. Open Control Panel, search for "Power Options", and click "Edit plan settings" next to your current power plan. You will see two dropdown menus: one for "Put the computer to sleep after" on battery, and one for plugged in. If either is set to "Never", change it to a time that makes sense — 10 or 15 minutes is common for a desktop, 5 or 10 for a laptop.
Click "Change advanced power settings" to open a detailed menu. Expand "Sleep" and check the settings underneath. Make sure "Sleep after" is not set to "Never" and that "Allow wake timers" is set to "Disabled". If you see "Hibernate after", set that to a time longer than sleep — for example, sleep after 10 minutes and hibernate after 30. Click explore and OK.
On a Mac, open System Preferences, go to "Energy Saver", and make sure the slider for "Put display to sleep after" is not set to "Never". Also check that "Prevent computer from sleeping automatically when the display is off" is unchecked. These settings are the Mac equivalent of Windows power options.
Test Sleep Mode and Confirm the Fix
Close all open programs and windows. Press the sleep button on your keyboard, or go to the Start menu, click the power icon, and select "Sleep". Your screen should go dark and your computer should be quiet within a few seconds. If it does not, the problem is still there.
Wait a few minutes and then move your mouse or press a key. The computer should wake up when ready. If it does not wake, or if it wakes but then goes back to sleep right away, something is still blocking it. Go back to the powercfg /requests command and check the list again — you may have missed a device or program.
If sleep works but your computer wakes up on its own after a few minutes, a device or program is waking it. Check Device Manager again for devices set to wake the computer, and check Task Manager for programs that might be polling the network or checking for updates.
Find What Is Blocking Sleep on Mac
Open Terminal — you can find it in Applications > Utilities or search for it with Spotlight. Type this command: pmset -g log | head -30 and press Enter. This shows you the last events that affected sleep on your Mac. Look for entries that say "Assertion" or "PreventUserIdleSystemSleep" — these are programs or processes blocking sleep.
For a more detailed list, type: pmset -g assertions and press Enter. This shows every active assertion preventing sleep, along with the program or process responsible. If you see a program you recognize, that is likely your culprit. Close the program and test sleep mode again.
If the output shows system processes with names like "kernel_task" or "WindowServer", the problem is usually a hardware issue or a system setting rather than a specific program. In that case, restart your Mac and check Energy Saver settings as described in the power settings section above.
Frequently Asked Questions
Why does my computer wake up when ready after I put it to sleep?
A device or program is sending a wake signal right after sleep starts. Run powercfg /requests on Windows or pmset -g assertions on Mac to see what is doing it. Usually it is a mouse, keyboard, or network adapter set to wake the computer. Disable the wake setting in Device Manager or System Preferences and test again.
Can I make my computer sleep without closing all my programs?
Yes. Sleep mode keeps your programs and files in memory and pauses them — it does not close them. However, some programs block sleep even when they are running in the background. If a program is preventing sleep, you may need to close it or change its settings, but other programs can stay open without affecting sleep.
What is the difference between sleep and hibernation?
Sleep pauses your computer and keeps everything in memory, using a small amount of power. Hibernation saves everything to your hard drive and powers off completely, using almost no power. Sleep is faster to wake from; hibernation is better for laptops you will not use for hours. You can set both to happen automatically after different amounts of time.
Is it bad to let my computer sleep instead of shutting it down?
No. Sleep is designed for this purpose and is safe to use regularly. It uses much less power than running normally but wakes faster than a full shutdown. Shut down your computer only when you will not use it for several hours or longer, or when you need to install updates.
My computer sleeps fine, but it wakes up at random times. How do I stop that?
Check Device Manager for devices set to wake the computer and disable that setting. Also check Task Manager for programs that might be polling the network or checking for updates on a schedule — antivirus software and cloud sync tools do this often. If the problem continues, disable "Allow wake timers" in Power Options advanced settings.