The fastest way to lock your computer without touching the mouse

The quickest keyboard shortcut to lock your computer is 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 who wants to use the computer will need to enter your password. This takes about one second and works from anywhere — you do not have to be at the desktop or in any particular program.

Locking your computer is different from shutting it down or putting it to sleep. When you lock it, all your programs stay open and running in the background, but nobody can see your screen or access your files without your password. It is the right move when you are stepping away from your desk for a few minutes or longer, especially in an office or shared space.

Key Takeaways

  • Windows key + L locks a Windows computer when ready from anywhere, even if you are in the middle of typing in a program.
  • Control + Command + Q locks a Mac, though some older Macs may use Control + Command + Eject instead.
  • A locked computer keeps your programs running but hides your screen behind a password wall that only you can unlock.
  • You can also lock your computer through the Start menu or Apple menu if you prefer not to use the keyboard shortcut.

How to lock a Windows computer with the keyboard

Press and hold the Windows key (the key with the Windows logo, usually between Ctrl and Alt on the left side of your keyboard), then press L while still holding the Windows key. Release both keys. Your screen will go blank or show a lock screen with the time and date, depending on your Windows version.

This shortcut works no matter what you are doing — you can be in the middle of typing an email, editing a spreadsheet, or watching a video. The lock happens when ready. When you come back, click anywhere on the lock screen or press any key, then type your password to unlock it.

If the Windows key + L shortcut does not work on your computer, it may have been disabled by your workplace or school. In that case, you can lock your computer through the Start menu instead: click the Start button, then click your user account picture in the top left corner, and select "Lock" from the menu that appears.

How to lock a Mac with the keyboard

On most modern Macs, press Control + Command + Q to lock your screen when ready. Your Mac will show the login screen, and you will need to enter your password to unlock it. This works the same way as the Windows shortcut — your programs keep running in the background.

Some older Mac models use a different shortcut: Control + Command + Eject. If Control + Command + Q does not work on your Mac, try that combination instead. You can also check your Mac's keyboard settings to see which shortcut is set up on your specific machine.

If neither shortcut works, you can lock your Mac through the Apple menu: click the Apple logo in the top left corner of your screen, then select "Lock [Your Name]" from the dropdown menu. This does the same thing as the keyboard shortcut, just with a few extra clicks.

What happens when your computer is locked

When you lock your computer, the screen goes dark or shows a lock screen, and nothing on the computer can be accessed without your password. Any files you had open stay open, any downloads that were running keep going, and any programs you were using remain active — they are just hidden behind the lock.

This is useful if you are downloading a large file and need to step away, or if you have a long task running in the background. Unlike shutting down or restarting, locking preserves everything exactly as you left it. When you unlock the computer, you are right back where you started.

The difference between locking, sleeping, and shutting down

A locked computer hides your screen behind a password but keeps everything running. A sleeping computer uses very little power and can wake up when ready when you move the mouse or press a key, but it is not password-protected — anyone can wake it and see your screen. A shut down computer turns off completely, closes all programs, and uses no power.

For security, locking is better than sleeping if you are stepping away for more than a few minutes. For power savings, sleeping is better than locking if you are only gone for a short time. Shut down when you are done for the day or will be away for hours.

Setting up a password so your lock actually protects you

The lock shortcut only works if you have a password set on your computer. If you do not have a password, anyone can unlock your computer by pressing a key or clicking the screen. On Windows, go to Settings > Accounts > Sign-in options and look for "Password" — you can add one there. On a Mac, go to System Preferences > Users & Groups, select your account, and click "Change Password."

Make your password something you can remember but that would be hard for someone else to guess. Avoid birthdays, names, or straightforward patterns. A mix of uppercase letters, lowercase letters, numbers, and symbols is strongest, but even a long phrase that only you know works well.

Troubleshooting when the keyboard shortcut does not work

If Windows key + L does not lock your Windows computer, the shortcut may have been disabled by your workplace, school, or antivirus software. Try the Start menu method instead: click Start, then your user account picture, then "Lock." If that does not work either, restart your computer and try again.

On a Mac, if Control + Command + Q does not work, make sure you are holding all three keys at the same time. Try Control + Command + Eject if you have an older Mac. You can also check System Preferences > Keyboard > Shortcuts to see if the lock shortcut has been changed or disabled on your machine.

If your computer has no password set, the lock screen may not appear at all — the screen will just go dark. Set up a password first, then try the shortcut again.

Frequently Asked Questions

Can I lock my computer if I am not at the keyboard?

No, you need to be at the keyboard to use the shortcut. If you need to lock your computer remotely, you would need to use a remote access tool or your computer's built-in remote lock feature if available. For most home and office setups, the keyboard shortcut is the standard way to lock.

Will my downloads keep going if I lock my computer?

Yes. When you lock your computer, all programs and downloads keep running in the background. Your computer stays on and connected to the internet, so any file downloads, uploads, or background tasks will continue until they finish.

What if I forget my password and my computer is locked?

On Windows, you can use your Microsoft account password or a password reset disk if you set one up beforehand. On a Mac, you can restart and use your Apple ID to reset your password. If neither of those options is available, you may need to contact your IT support or take your computer to a technician.

Is locking my computer the same as logging out?

No. Locking keeps your programs and files open but hidden. Logging out closes all your programs and returns the computer to the login screen. Locking is faster and better if you plan to come back soon; logging out is better if someone else needs to use the computer.

Can I set my computer to lock automatically after a certain time?

Yes. On Windows, go to Settings > Accounts > Sign-in options and look for "Require sign-in" — you can set it to lock after 1 minute, 5 minutes, or longer. On a Mac, go to System Preferences > Security & Privacy > General and check "Require password" after sleep or screen saver begins, then set the delay you want.