Lock the screen on a Mac with a keyboard shortcut
Walking away from an unlocked Mac in a shared office is a two second problem with a one second solution, and most people solve it the slow way: Apple menu, scroll, click Lock Screen. There is a shortcut, it has been in macOS for years, and it sits next to a very similar shortcut that logs out instead. Pressing the wrong one in a hurry closes every open document.
There is also a second issue behind the first. Locking the screen and requiring a password are separate settings, and a Mac can be locked in the visual sense while still waking without asking for anything. Getting both right takes one shortcut and one setting.
The shortcut, and the one that looks like it
The shortcut is Control-Command-Q. Apple's wording for it is three words long.
Control-Command-Q : Lock your screen. Source: support.apple.com, read September 27, 2026
One key away sits Shift-Command-Q, which logs out of the macOS user account and asks for confirmation first. A harder version exists, Option-Shift-Command-Q, which logs out immediately with no confirmation at all. Both close apps. Locking closes nothing.
The practical difference is what is waiting on return. After Control-Command-Q, every window, every unsaved draft and every running process is exactly where it was. After a log out, the session has ended. For stepping away from a desk, locking is almost always the intended action, and the two shortcuts being adjacent is the reason to learn the right one deliberately rather than reaching for whichever comes to mind.
Apple adds a note that covers the whole group of power and session shortcuts, and it explains an odd first experience with them. Some of these shortcuts need to be held for slightly longer than other shortcuts, which is deliberate: it makes them harder to trigger by accident. A quick tap of Control-Command-Q that appears to do nothing is usually a tap that was too quick.
There is a third route through the menus for anyone who prefers it, and it is the same action. Choosing Lock Screen from the Apple menu starts the screen saver and locks the session, which is why Apple's screen saver documentation lists it as one way to start the screen saver immediately.
The Touch ID key is also a lock key
On a Mac with Touch ID in the keyboard, there is a shortcut with no modifiers at all. Apple's list of power button behaviours states it directly: on keyboards with Touch ID, press to lock your screen.
That is a single press, not a press and hold, and it does not put the Mac to sleep. It is the fastest of all the options and the easiest to teach to someone who will not remember a three key combination.
The behaviour of the same key on machines without Touch ID is entirely different, which is where confusion comes from when advice is passed between people on different hardware. On built-in keyboards without Touch ID, pressing and holding the power button for 1.5 seconds puts the Mac to sleep, and Option-Command-Power button does the same thing without the wait. Control-Shift-Power button puts the displays to sleep. Control-Power button shows a dialog asking whether to restart, sleep or shut down. All of those are qualified in Apple's own documentation as applying to built-in keyboards without Touch ID.
So the honest answer to the question of which key locks a Mac depends on the keyboard in front of the person asking. With Touch ID, the power button. Without it, Control-Command-Q.
The way Apple words these entries is itself informative. The lock behaviour is attributed to keyboards with Touch ID, with no mention of whether the keyboard is built in, while the sleep, restart and display shortcuts are attributed specifically to built-in keyboards without Touch ID. A desk setup with a separate keyboard therefore sits in a different row of that list than the laptop it is plugged into, and the fast option available on one is not necessarily present on the other. Learning the key combination as well as the key is what makes the habit survive moving between the two.
Locking, sleeping and logging out are three different things
These get used interchangeably in conversation and they are not interchangeable in behaviour.
| Action | Shortcut | What happens to open apps | What happens on return |
|---|---|---|---|
| Lock screen | Control-Command-Q | Nothing, all stay running | Password, Touch ID or Apple Watch |
| Display to sleep | Control-Shift-Power button | Nothing, all stay running | Depends on the Lock Screen setting |
| Sleep | Option-Command-Power button | Nothing, all suspended | Depends on the Lock Screen setting |
| Log out | Shift-Command-Q | All apps quit | Full login |
The middle two rows are the source of most false confidence. Putting a display to sleep darkens the screen, and if the password setting underneath is not configured, moving the trackpad brings the desktop straight back. Locking is the only one of the four that asks for credentials unconditionally.
Locking is not the same as requiring a password
This is the setting that decides whether any of the above actually protects anything, and it lives in System Settings under Lock Screen in the sidebar.
The relevant option is "Require password after screen saver begins or display is turned off," and Apple's description of it is the clearest statement of what it does: it locks the Mac when it is left in an idle state, and when the Mac wakes, a user login password must be entered before the Mac can be used. The pop-up menu next to it sets how much time passes before the password becomes mandatory.
A grace period here is what turns an apparently locked Mac into an open one. If the setting allows five minutes, then a display that went to sleep three minutes ago wakes without asking. For a machine that travels, immediately is the setting that matches the intent.
Two more options on the same screen matter in an office. Show message when locked displays a short message in the login window, which Apple notes can be used to provide contact information for a lost Mac. Login window shows controls whether the screen offers a list of user names or requires both a user name and password to be typed, and the second is the stricter of the two.
A separate and stronger setting sits elsewhere. Under Privacy & Security, then Advanced, turning on "Log out automatically after inactivity" ends the session after a chosen period rather than merely locking it. That is the right tool for a machine left unattended for hours, and the wrong one for stepping out for coffee, because it closes everything.
Hot corners, for when a shortcut is the wrong gesture
Not every situation suits a key combination. A hand already on the trackpad, or a hand holding a coffee, argues for a gesture instead.
macOS can assign an action to each corner of the screen. In System Settings, click Desktop & Dock in the sidebar, then Hot Corners, and each corner offers a pop-up menu with options including Lock Screen. Apple's own example is exactly this use: lock the screen when the pointer moves to the top-right corner. Its guidance on securing an idle Mac makes the same suggestion, describing a hot corner as something to click whenever the screen should be locked immediately.
One detail makes hot corners usable rather than infuriating. While the pop-up menus are open, holding Command, Shift, Option or Control, or a combination of them, attaches that modifier to the corner. The action then fires only when the corner is reached with the key held, which is what stops a lock happening every time the pointer drifts into a corner on the way to a scroll bar.
Worth knowing before setting these up: the bottom-right corner is already assigned by default, to Quick Note. Anyone who has wondered why a note window keeps appearing has found the reason.
What locking does not do
Two limits are documented and both are worth knowing before treating a locked screen as a safe.
The first is about other people at the same machine. Apple states it without softening: locking the screen does not prevent other users from turning off the Mac, restarting it, and logging in. The practical advice attached to it is to save work before walking away if the apps in use do not save automatically, because a restart by someone else takes unsaved changes with it.
The second is about administrators. An administrator name and password can unlock the screen for the administrator or for a standard user, but not for another administrator. In a household or team where several accounts have administrator rights, one person cannot clear another's locked screen, and the only route through is a restart, which brings the first limit back into play.
Neither of these is an argument against locking. They are an argument for the lock being one layer among several, with FileVault and separate user accounts doing the work that a locked screen cannot.
Apple's own checklist for a secure Mac puts them in that order. Separate accounts with logins required come first, because that is what stops an unauthorised person using the machine at all and keeps each user's files out of reach of the others. Securing the Mac when it is idle comes next, and it is described as two things rather than one: setting the Mac to log out after a period of inactivity, and requiring a password to wake it from sleep or from the screen saver. Limiting how many accounts hold administrator rights comes after that, on the reasoning that a compromised standard account does far less damage than a compromised administrator one. On Macs with Apple silicon or an Apple T2 Security Chip, data is encrypted automatically, and FileVault adds the requirement of a login password before that data can be read.
Making the habit visible
A shortcut only becomes a habit if it is easier than the alternative, and for the first week or two a visible reminder helps. Control Center can carry one: Control-clicking an item there and choosing Add to Menu Bar pins it to the top of the screen, and holding Command and dragging an icon off the bar removes it again. Fast User Switching is one of the controls that can be added this way, and it puts the account name where it can be seen.
The catch is space. That strip is where every resident utility places its icon, macOS calls those the status menus, and on a MacBook with a notch the row runs out well before the icons do. Anything pinned as a reminder ends up behind the ones that got there first.
Deciding what stays in view is a separate exercise from locking the screen, and it is the one that makes the rest reachable. Apple's own controls are turned on and off under Menu Bar in System Settings, and for third party apps, a menu bar manager is what puts the row back under control.
What to change first
Learn Control-Command-Q, or use the Touch ID key if the keyboard has one, and then open Lock Screen settings and set the password requirement to immediately rather than leaving a grace period in place. Those two changes together take under a minute and cover the case the shortcut is for. If the top of the screen is too crowded to keep anything useful in view, Koffret is for clearing it out.
Frequently asked questions
What is the keyboard shortcut to lock the screen on a Mac?
Control-Command-Q. Apple's own description is simply that it locks your screen, and it leaves every app and document running. On a Mac with Touch ID in the keyboard there is a shorter route: a single press of the Touch ID key locks the screen without any modifier keys.
Why does nothing happen when I press Control-Command-Q?
Usually because it was pressed too briefly. Apple notes that some of the sleep, log out and lock shortcuts need to be held slightly longer than other shortcuts, specifically to avoid triggering them by accident. Holding the combination for a moment longer is normally all that is needed.
What is the difference between Control-Command-Q and Shift-Command-Q?
Control-Command-Q locks the screen and leaves everything running. Shift-Command-Q logs out of the user account, which quits all apps, and it asks for confirmation first. Option-Shift-Command-Q logs out immediately with no confirmation. For stepping away from a desk, the locking shortcut is the one intended.
Does locking the screen mean nobody can get into my Mac?
Not entirely. Apple states that locking the screen does not prevent other users from turning off the Mac, restarting it, and logging in. Unsaved work can be lost that way, so save before walking away. FileVault and separate user accounts are what protect the data itself.
How do I make my Mac ask for a password as soon as it locks?
Open System Settings, click Lock Screen in the sidebar, then set the pop-up menu next to "Require password after screen saver begins or display is turned off" to the shortest available option. Any delay set there is a window in which the screen looks locked but wakes without asking for anything.