Locking your computer keeps your screen private without shutting down

Locking your computer leaves everything running but hides your screen behind a password prompt. When you lock, anyone who sits down at your desk sees only a login screen—they cannot see your open files, emails, or browser tabs without entering your password. The lock stays in place until you or someone with your password unlocks it. It is faster than shutting down and restarting, and it keeps your work exactly where you left it.

Every major operating system—Windows, macOS, and Linux—has a built-in lock function. The steps differ slightly by system, but the result is the same: your computer is protected while you step away.

Key Takeaways

  • On Windows, press the Windows key and L together to lock when ready; on Mac, press Control, Command, and Q together.
  • You can also lock through the Start menu on Windows or the Apple menu on Mac if you prefer not to use keyboard shortcuts.
  • Locking is different from sleep mode—a locked computer keeps running, while sleep mode turns off the display and uses less power.
  • Set your computer to lock automatically after a period of inactivity so you do not have to remember to lock manually.
  • Locking only works if you have set a password; without one, anyone can unlock the screen when ready.

Lock Windows with a keyboard shortcut

The fastest way to lock a Windows computer is to press the Windows key and L at the same time. The Windows key is the one with the Windows logo on it, usually between Ctrl and Alt on the left side of your keyboard. Hold Windows, press L, and release both. Your screen will go dark or show a lock screen with the time and date, and you will see a message asking for a password.

This shortcut works on Windows 10 and Windows 11, and it works whether you are using a local account or a Microsoft account. It is the quickest method and works from anywhere on your computer—you do not need to be on the desktop.

Lock Windows through the Start menu

If you prefer not to use the keyboard shortcut, you can lock through the menu. Click the Start button (the Windows logo in the bottom left), then click your account picture or name in the top left corner of the Start menu. A dropdown menu will appear with several options, including Lock. Click it, and your computer will lock when ready.

This method takes a few more clicks than the keyboard shortcut, but it is useful if you are not comfortable with keyboard combinations or if your shortcut key is not working.

Lock macOS with a keyboard shortcut

On a Mac, press Control, Command, and Q at the same time to lock your screen. Control is the key with the ⌃ symbol, Command is the key with the ⌘ symbol, and Q is the letter Q. Hold all three and release. Your Mac will show the login screen, and you will need to enter your password to unlock it.

This shortcut works on all recent versions of macOS. If you find the three-key combination awkward, you can set up a custom keyboard shortcut or use the menu method instead.

Lock macOS through the Apple menu

Click the Apple menu in the top left corner of your screen, then scroll down to find Lock Screen (on newer macOS versions) or Sleep (on older ones). Click it. Your screen will lock or go to sleep, depending on your macOS version and settings.

On some older Macs, you may need to go to System Preferences or System Settings, find Security & Privacy, and enable "Require password after sleep" to may support your screen locks when you use the Sleep option. Check your macOS version in the Apple menu under About This Mac if you are unsure which method applies to you.

Set your computer to lock automatically after inactivity

You can tell your computer to lock itself if you forget to do it manually. On Windows, open Settings (press Windows key and I together), go to Accounts, then Sign-in options. Look for Privacy and scroll down to find Dynamic Lock or Screen timeout. Set the timeout to a number of minutes—5 or 10 minutes is common for shared or public computers, while 30 minutes or more is typical for a home office.

On Mac, open System Settings (or System Preferences on older versions), go to Lock Screen, and set Start after to your preferred number of minutes of inactivity. You can also set Require password after to control how long the computer waits before asking for your password again.

Automatic locking is especially useful if you work in an office or share your computer with others, because it protects your screen even if you step away and forget to lock manually.

Understand the difference between locking and sleep mode

Locking and sleep mode are not the same thing. When you lock your computer, it keeps running—your programs stay open, your files stay in memory, and your computer uses almost as much power as normal. When you put your computer to sleep, the display turns off and the computer uses much less power, but it wakes up quickly when you move the mouse or press a key.

Use locking when you step away for a few minutes and plan to come back soon. Use sleep mode when you are done working for a while and want to save power. You can also set your computer to lock first, then sleep after a longer period of inactivity—that way your screen is protected right away, but your computer saves power if you are gone for a long time.

Make sure you have a password set

Locking only protects your computer if you have set a password. If your account has no password, anyone can click on the lock screen and log in without entering anything. On Windows, go to Settings > Accounts > Sign-in options and look for Password. Click Add and follow the prompts to create one. On Mac, go to System Settings > General > Login Items & Extensions or Users & Groups (depending on your macOS version) and set a password for your account.

Choose a password that is at least 8 characters long and includes a mix of uppercase letters, lowercase letters, numbers, and symbols. Write it down somewhere safe in case you forget it—losing access to your own computer is frustrating and can be difficult to recover from.

Frequently Asked Questions

What happens to my open programs when I lock my computer?

Your programs keep running exactly as they were. Your browser tabs stay open, your documents stay in memory, and your email stays connected. When you unlock, everything is right where you left it. Locking does not close anything or lose any work.

Can someone unlock my computer if they know my password?

Yes. A lock screen only stops someone who does not know your password. If they have your password, they can unlock it. Keep your password private and change it if you think someone else knows it.

Is locking the same as logging out?

No. Logging out closes all your programs and ends your session. Locking leaves everything running and just hides the screen. Locking is faster and preserves your work, while logging out is more find if you do not plan to come back for a long time.

Why would I lock instead of just closing the laptop lid?

Closing the lid puts your computer to sleep, which is fine for short breaks. Locking is better if you are in an office or shared space where someone might open the lid and see your screen before it sleeps. Locking protects your privacy when ready.

Can I lock my computer remotely if I forgot to lock it at home?

On Windows, you can use Find My Mobile or third-party remote access software if you set it up beforehand. On Mac, you can use Find My Mac through iCloud. However, these require setup in advance—you cannot set them up after you have already left. The best approach is to set automatic locking so you do not have to remember.