How-To

How to Prevent Your Computer From Sleeping on Windows & Mac

8 min read ยท March 2025 ยท By the KeepAwake team

Your computer going to sleep is the underlying cause of a chain of problems: Teams shows Away, Slack goes inactive, your screen locks mid-presentation, downloads pause, and remote desktop sessions disconnect. Here's every method to prevent it, starting with the most accessible and working down to alternatives for locked corporate devices.

Windows: Built-In Power Settings

The most direct approach on Windows is adjusting Power & Sleep settings:

  • Press Windows + I to open Settings
  • Go to System โ†’ Power & Sleep
  • Under "Screen," set to Never (while plugged in)
  • Under "Sleep," set to Never (while plugged in)

This is the simplest solution if your device settings aren't locked by Group Policy. The caveat is that it applies permanently until you change it back โ€” your screen will never sleep even when you genuinely step away.

For a more nuanced approach, Windows 11 has a "Presence sensing" feature on some devices with appropriate sensors โ€” it can detect when you've walked away and allow sleep then, but keep the screen on when you're sitting in front of it. This is found under Settings โ†’ System โ†’ Power & Sleep โ†’ Screen and sleep โ†’ When nobody's looking at the screen.

Windows: Battery Saver and Power Plan Settings

If the simple Power & Sleep settings aren't showing the "Never" option, you may need to check your power plan. In the Control Panel (not Settings), go to Hardware and Sound โ†’ Power Options. Choose "High Performance" or "Balanced" and then edit the plan settings to set display and sleep timeouts to Never. Some OEM power management utilities override Windows' native settings โ€” if you have a Dell, HP, or Lenovo laptop with their power management app installed, configure the settings there as well.

Mac: Energy Saver and Display Settings

On macOS Ventura and later:

  • Open System Settings
  • Go to Lock Screen
  • Set "Turn display off on battery when inactive" and "Turn display off on power adapter when inactive" to Never (or a long duration)
  • Also check Battery โ†’ Options and disable "Enable Power Nap"

On macOS Monterey and earlier, the settings are under System Preferences โ†’ Energy Saver (or Battery). The "Prevent computer from sleeping automatically" checkbox is the key toggle.

macOS also has a built-in command-line tool: caffeinate. Running caffeinate -d in Terminal prevents the display from sleeping for as long as the Terminal window is open. caffeinate -t 3600 prevents sleep for 3600 seconds (1 hour). This is useful for temporary sessions without changing system settings permanently.

When Settings Are Locked by IT (The Corporate Laptop Problem)

This is where many remote workers get stuck. On corporate-managed Windows devices, Group Policy can lock the Power & Sleep settings โ€” the dropdowns are grayed out, and you can't change them. On Mac, MDM (Mobile Device Management) profiles set by IT can similarly restrict energy preferences.

The practical options when settings are locked:

Browser-Based Wake Lock (Most Reliable)

The Screen Wake Lock API is a W3C web standard that allows a web page to request that the operating system suppress sleep and idle detection. Crucially, this works through the browser without requiring any system-level permissions or admin rights. IT's Group Policy controls system settings โ€” it doesn't control what a browser tab can request via web standards.

KeepAwake uses this API, along with Picture-in-Picture video and AudioContext techniques, to prevent sleep without any installation. Open the page, click Start, and your computer won't sleep for as long as the tab is running. This works on corporate laptops where every other method is blocked.

macOS caffeinate Command (Mac Only)

On Macs, even with MDM profiles, the Terminal application and the caffeinate command are typically available (IT would have to specifically block Terminal access, which is uncommon). Running caffeinate -d in a Terminal window prevents display sleep without requiring any permissions.

Presentation Mode (Windows Temporary Fix)

Windows has a "Presentation mode" designed to prevent sleep during presentations. Right-click the battery icon in the system tray and look for "Presentation Mode" โ€” if available on your device, it prevents sleep and notifications. This varies by Windows version and OEM configuration.

Why Preventing Sleep Solves So Many Other Problems

Sleep prevention isn't just about a screen โ€” it's about the entire chain of consequences that follows when your OS enters idle state. Teams and Slack use the OS idle signal to flip statuses. Remote desktop (RDP, Citrix) sessions disconnect when the session is idle. VPN connections on some configurations terminate on sleep. File downloads and cloud sync operations pause. Background processes get throttled.

Preventing your computer from ever registering as idle solves all of these at once. This is why a keep-awake tool like KeepAwake โ€” which specifically prevents OS-level idle detection โ€” is one of those tools that seems small but has an outsized effect on a remote work day.

Works on locked corporate laptops: KeepAwake uses browser-level Wake Lock โ€” no admin rights needed, no installation, works even when Group Policy locks your power settings.