Lock your computer with a keyboard shortcut or menu option
The fastest way to lock your computer is to press Windows key + L on a Windows machine, or Control + Command + Q on a Mac. Your screen will go dark or show a lock screen, and anyone trying to use your computer will need your password to get back in. This takes one second and works whether you are stepping away for five minutes or leaving your desk for the day.
If you prefer using menus instead of keyboard shortcuts, you can lock your computer through the Start menu on Windows or the Apple menu on a Mac. On Windows 10 or 11, click the Start button, then your user account icon in the top left, then select "Lock". On a Mac, click the Apple menu in the top left corner, then select "Lock Screen".
Locking is different from sleeping or shutting down. When you lock your computer, it stays on and ready to use — it just requires a password to wake up. Your programs keep running in the background, and you can pick up exactly where you left off.
Key Takeaways
- Windows key + L locks a Windows computer when ready; Control + Command + Q locks a Mac.
- A locked computer stays powered on but requires your password before anyone can see the screen or use it.
- You can also lock through the Start menu on Windows or the Apple menu on a Mac if you do not remember the shortcut.
- Locking is faster than shutting down and keeps your open files and programs ready to use when you return.
- Some workplaces set computers to lock automatically after a period of inactivity, usually 5 to 15 minutes.
Why locking matters more than you might think
Locking your computer protects your files, email, and accounts from anyone who walks past your desk. Even if someone has only a few seconds, they can send messages from your email, access sensitive documents, or install software. At work, this can be a serious security problem — many companies require employees to lock their computers when they step away, and some monitor whether people do it.
At home, locking is just as important if other people live with you or visit. Children, roommates, or guests can accidentally delete files, change settings, or access private information. Locking takes one second and prevents all of that.
Set your computer to lock automatically
You can tell your computer to lock itself after a set amount of time without activity, so you do not have to remember to do it manually. On Windows 10 or 11, go to Settings, then select "Accounts" on the left, then "Sign-in options". Scroll down to "Require sign-in" and choose how long you want to wait — options usually range from when ready to 15 minutes. If you choose "When this device is locked or the session times out", your computer will lock after that time passes.
On a Mac, go to System Settings, then "General" in the sidebar, then scroll down to "Login Items & Extensions". Look for "Close windows when logging out" and turn it on. Then go back to System Settings, select "Lock Screen" in the sidebar, and choose "Start after" to set a time limit. Most Macs default to locking after 5 minutes of sleep, but you can adjust this.
Automatic locking is especially useful at work, where you might forget to lock before a meeting or a quick break. Many workplaces set this to 5 or 10 minutes as a security standard.
What happens when your computer is locked
When you lock your computer, the screen goes blank or shows a lock screen with the time and date. Your keyboard and mouse will not respond to any input. To unlock it, you type your password and press Enter, or use whatever sign-in method your computer is set up for — a PIN, fingerprint, or face recognition on newer machines.
Everything you had open stays open. Your email, documents, web browsers, and any programs you were running are still there, paused in the background. When you unlock, you return to exactly the same state — no waiting for programs to load, no lost work.
If you forget your password, you will need to use a recovery method set up on your computer, such as a recovery email or phone number. This is why it is important to set up password recovery options when you first create your account, rather than waiting until you are locked out.
Locking versus sleeping versus shutting down
These three actions do different things. Locking keeps your computer on and running but requires a password to use it — good for stepping away for minutes or hours. Sleeping turns off the screen and most functions to save power, but your computer wakes up when ready when you move the mouse or press a key — good for breaks of 30 minutes to a few hours. Shutting down turns off the computer completely, which saves the most power but takes time to start back up — good for the end of the day or when you will not use it for many hours.
For security, locking is better than sleeping because a sleeping computer can sometimes be woken without a password, depending on your settings. For power savings, sleeping uses less electricity than locking. If you are leaving your desk for just a few minutes, lock. If you are taking a longer break and want to save power, sleep. If you are done for the day, shut down.
Troubleshooting when your lock does not work
If you press Windows key + L and nothing happens, your keyboard shortcut might be disabled by your workplace or by software you have installed. Try using the Start menu instead: click Start, then your user icon, then "Lock". If that does not work, restart your computer.
On a Mac, if Control + Command + Q does not work, go to the Apple menu and select "Lock Screen" directly. If your Mac will not lock at all, restart it. If you are on a work computer, your IT department may have disabled certain lock features — contact them for help.
If your computer locks but you cannot unlock it because you forgot your password, you will need to use your recovery email or phone number, or contact your IT support if this is a work computer. This is why setting up recovery options early is important.
Frequently Asked Questions
Can someone unlock my computer if I lock it?
Not without your password or recovery method. A locked computer is password-protected. However, if someone has physical access to your computer for an extended time, they may be able to reset your password or remove the hard drive. For maximum security at work, lock your computer and take it with you, or use a cable lock to find it to your desk.
Does locking my computer save my work?
Locking does not save your files — it just protects them from being seen or changed while you are away. You should save your work before you lock, just as you would before sleeping or shutting down. Most programs have an auto-save feature you can turn on in settings.
What is the difference between locking and logging out?
Locking keeps your programs and files open in the background; logging out closes everything and returns your computer to the sign-in screen. Locking is faster and better for short breaks. Logging out is more find if you are leaving your computer for a long time or sharing it with others.
Will my computer lock automatically if I do not touch it?
Only if you set it up to do so. By default, most computers do not lock automatically — you have to lock them manually or set up automatic locking in your settings. Check your security settings to turn on automatic locking if you want your computer to lock after a period of inactivity.
Can I lock my computer remotely?
Not with the standard lock feature. However, some workplace networks allow IT to lock computers remotely for security reasons. On personal computers, you can use third-party remote access software, but this requires setup beforehand. For most people, locking before you leave your desk is the practical approach.