keepscreenunlocked.

Mac

Keep your Mac's screen on, without the Terminal.

Works in Safari, Chrome, or Firefox — no app to download, no caffeinate command to remember.

Inactive

Pick a duration and hit start.

Duration

Stealth screen
— covers the page with black (or your own wallpaper) so it looks like nothing is open.
Fullscreen
— the same cover, edge to edge. Press Esc to leave.
Ambient sound

Starts only when you press Play. It fades out on its own, when you stop the tool, and when you enter stealth screen (unless you tick the box above).

Feedback

macOS's own options, and when to use this instead

macOS has a built-in Terminal command for this: caffeinate, which can keep the display and/or system awake indefinitely or for a set duration. Apps like Amphetamine wrap the same idea in a menu-bar UI if you'd rather not use Terminal.

Both are great if you're comfortable with them. This tool is for the times you'd rather not open Terminal, aren't on your own machine (a work Mac, a borrowed one), or just want something that needs zero setup and leaves nothing installed behind.

Safari has supported the Screen Wake Lock API since version 16.4 (2023) — if you're on an older Safari, update it or use Chrome/Firefox instead, both of which support it too.

FAQ

Does this work the same as `caffeinate -d`?
Functionally similar for keeping the display awake — the real difference is this runs from a tab with no install, while caffeinate runs from Terminal and keeps working even if you quit the browser.
Will it keep my MacBook awake with the lid closed?
No — a closed lid triggers hardware-level sleep that no browser tab (or Terminal command, for that matter) running inside macOS can override on its own.

Running a long agent job on a Mac? Keep a Mac awake while Cursor or Claude Code runs.

What actually puts a Mac to sleep

A Mac has two separate things people call "sleep": the display turning off, and the whole computer sleeping. Preventing one does not prevent the other, which is why a keep-awake method can work for a presentation but fail for a download.

  • Display sleep: the screen turns off after a period with no input. Set it in System Settings → Lock Screen ("Turn display off on battery when inactive" and "on power adapter when inactive"). The wording and location vary a little between macOS versions.
  • System sleep: the whole Mac suspends. Network activity, downloads and background tasks pause. Battery and power-adapter options control this.
  • Screen saver and password: in the same Lock Screen pane, "Require password after screen saver begins or display is turned off" decides how soon you must sign in again. A short value here makes a Mac feel locked even when the display barely turned off.

Using caffeinate in Terminal

macOS includes a command-line tool, caffeinate, that holds the Mac awake for as long as it runs. It is built in, needs no install and no admin rights, and is the most reliable option for a long task.

CommandWhat it does
caffeinate -dKeeps the display from sleeping until you press Ctrl-C.
caffeinate -iKeeps the system from idle sleeping.
caffeinate -dis -t 3600Holds display, idle and system sleep (on power) off for 3600 seconds, then stops.
caffeinate -i some-commandRuns the command and keeps the Mac awake until that command finishes. Handy for builds, backups and scripts.

To check what is currently holding the Mac awake, run pmset -g assertions. It only reads information and shows which processes have asked for the display or system to stay awake.

Closing the lid on a MacBook

A MacBook sleeps when the lid closes. The well-known exception is "clamshell mode": with an external display connected and the Mac plugged into power, you can close the lid and keep working on the external screen. Without that setup, no browser tab, app or setting reliably keeps a closed MacBook running.

If you want a long task to survive you walking away with the lid open, use caffeinate or the tool above, and keep the Mac on its charger.

Other things that dim or lock a Mac

  • Hot corners. In System Settings → Desktop & Dock you can assign a screen corner to "Put Display to Sleep" or "Lock Screen". Moving the pointer into that corner by accident sleeps or locks the Mac.
  • Low Power Mode and battery settings. Power-saving modes can shorten the display timeout. If the screen dims faster on battery, check the Battery pane.
  • Managed Macs. Devices enrolled in work management can have a screen lock enforced. If a setting is greyed out, your organisation controls it.

More on why displays dim in why does my screen keep dimming?.