How to Change the Sleep Time on a Mac or MacBook

Open System Settings, click Lock Screen, and set "Turn display off on battery when inactive" and "Turn display off on power adapter when inactive" to the time you want. The Mac sleeps after the display turns off. To keep it running with the screen dark, turn on "Prevent automatic sleeping" in Battery > Options on a MacBook or in Energy on a desktop.

Change the sleep time on a MacBook

  1. Choose Apple menu > System Settings.
  2. Click Lock Screen in the sidebar. You may need to scroll down.
  3. Open the pop-up menu for "Turn display off on battery when inactive" and pick a time.
  4. Do the same for "Turn display off on power adapter when inactive." Each one only applies to its own power source.
  5. To keep the MacBook running after the screen goes dark while it's plugged in, click Battery in the sidebar, click Options, and turn on "Prevent automatic sleeping on power adapter when the display is off."

There's no separate "computer sleep" slider any more. The display timer is the one you set, and the system follows it unless step 5 tells it not to.

Change the sleep time on an iMac, Mac mini or Mac Studio

  1. Choose Apple menu > System Settings.
  2. Click Lock Screen and set the display-off timer to the time you want.
  3. Click Energy in the sidebar. Turn on "Prevent automatic sleeping when the display is off" if you want the Mac to keep working with the screen dark.
Note
Older macOS versions kept all of this in System Preferences > Energy Saver with sliders. If you see sliders, you're on an older release, and the same ideas apply.

Change how fast it asks for a password

A lot of people searching for the sleep time want the lock delay. In Lock Screen settings, "Require password after screen saver begins or display is turned off" sets how long after the screen goes dark your Mac asks for a password. It doesn't change when the screen goes dark. Your company may have this one locked.

Check or set the timers in Terminal

pmset -g prints the current values in minutes: displaysleep for the screen and sleep for the system. If an app is holding the Mac awake, the sleep line names it. Our guide to "sleep prevented by powerd" explains that note.

To set them, use sudo pmset with -b for battery, -c for the charger or -a for both. For example, sudo pmset -c displaysleep 20 turns the screen off after 20 minutes on the charger. If your Mac sleeps at the same time every day, pmset -g sched shows scheduled sleep and wake events.

What time to pick

Short timers save battery and keep a screen from sitting lit on an empty desk. Long timers stop the Mac from dozing off while you read, watch a long build or wait on a download. Any single number is a compromise, because it applies all day.

That's the gap Shake It On fills. Leave a short timer in place. Shake It On moves the cursor slightly to keep the Mac awake only when your rules say so: plugged in, a chosen app running, inside your work hours. It pauses for the camera and Focus. The rest of the time your short timer does its job.

Keep a short sleep timer and stay awake when it counts. Shake It On is $9.99 once for macOS 14 or later.

Frequently Asked Questions

Where is the sleep setting on a Mac?
On current macOS the timer is in System Settings > Lock Screen, as "Turn display off when inactive" (a MacBook has one for battery and one for the power adapter). The switch that keeps the Mac running after the screen goes off is in Battery > Options on a MacBook and in Energy on a desktop Mac.
Why can't I find Energy Saver on my Mac?
Newer macOS versions moved the display timer to Lock Screen settings. Desktop Macs have an Energy section for the remaining options, and MacBooks keep them under Battery > Options.
How do I make my MacBook not sleep at all?
Set both display-off timers in Lock Screen to their longest value and turn on "Prevent automatic sleeping on power adapter when the display is off" in Battery > Options. That applies all the time, so many people use Shake It On instead to keep the Mac awake only while plugged in, during work hours or while a chosen app runs.
Keep your Mac awake the easy way.
Shake It On lives in your menu bar and uses organic mouse movement to prevent sleep. Set it once and forget it.
One-time purchase. No subscription. Free updates forever.
Lifetime license · macOS 14+
Apple Pay, Google Pay or card. Your download starts right after payment, and you can re-download anytime with your purchase email.