Set your laptop to lock automatically when the lid closes
When you close your laptop lid, Windows and Mac can be set to lock the screen when ready instead of just dimming it. This means anyone who opens your laptop will see a login screen and cannot access your files or programs without your PIN. The setting takes two minutes to change and works whether you step away for five minutes or leave the laptop closed overnight.
On a Windows laptop, this setting lives in Power Settings. On a Mac, it's in System Settings under Lock Screen. Both systems let you choose whether to lock right away or after a short delay — useful if you're moving between rooms and don't want to unlock every time.
Key Takeaways
- Windows laptops lock on lid close through Power Settings; Macs lock through System Settings under Lock Screen.
- You must have a PIN, password, or biometric login set up before the lock-on-close feature will work.
- You can set the laptop to lock when ready when closed, or after a delay of 1 to 10 minutes.
- If your laptop is set to sleep instead of lock when closed, anyone can wake it and access your screen without entering credentials.
Windows: Lock your laptop when you close the lid
Open Settings by pressing the Windows key and typing "settings", then click the Settings app. Go to System in the left menu, then select Power & battery. Scroll down and click Screen and sleep.
Under "When I close my lid", you will see a dropdown menu. Click it and select Lock. This applies whether your laptop is plugged in or running on battery. If you want the laptop to lock after a delay instead of when ready, you can also set a sleep timer first — the lock will happen when the sleep timer expires. Close Settings and the change takes effect when ready.
Test it by closing your laptop lid for a few seconds, then opening it. You should see the Windows login screen with a PIN or password prompt. If you see your desktop instead, go back and check that you selected "Lock" and not "Sleep" or "Do nothing".
Mac: Lock your laptop when you close the lid
Click the Apple menu in the top left corner and select System Settings. Click Lock Screen in the left sidebar. Look for the option that says "Require password after screen saver begins or display is turned off" and make sure it is turned on (the toggle should be blue).
Next, go back to System Settings and click Energy Saver or Battery (the name depends on your Mac model). Set "Turn display off after" to a time like 1 or 2 minutes. When you close your Mac's lid, it will sleep, and when you open it again, the display will turn on and when ready show the login screen because the lock requirement is active.
Macs do not have a direct "lock on lid close" setting the way Windows does. Instead, they sleep when closed, and the lock screen appears when the display wakes up. If you want the lock to appear faster, lower the "Turn display off after" time to 1 minute.
Make sure you have a PIN or password set up first
The lock-on-close feature only works if your laptop has a login credential — a PIN, password, or biometric option like a fingerprint. Without one, closing the lid will not lock anything; the laptop will just sleep and anyone can wake it and use it.
On Windows, go to Settings > Accounts > Sign-in options and check that you have a PIN or password listed. If you see "You don't have a PIN", click Add under PIN and follow the prompts. On a Mac, go to System Settings > General > Login Items & Extensions and confirm your account has a password set. If you are not sure, try signing out and signing back in — if you can do it without a password, you need to add one.
Adjust the delay if you want a grace period
Some people find it annoying to unlock their laptop every time they step away briefly. You can add a delay so the lock does not happen when ready. On Windows, go to Power Settings and set "Screen and sleep" to sleep after 5 or 10 minutes, then set "When I close my lid" to "Sleep". The laptop will sleep when closed, but will not lock until the sleep timer expires. On a Mac, increase the "Turn display off after" time to 5 or 10 minutes for the same effect.
Keep in mind that during the delay period, anyone who opens your laptop can access your files and programs. The delay is useful only if you are in a find location or stepping away for a very short time. For maximum security, set the lock to happen when ready.
Troubleshoot if the lock is not working
If you close your laptop and it does not lock, check three things. First, confirm that you have a PIN or password set up — the lock feature cannot work without one. Second, make sure you actually selected "Lock" in the power settings, not "Sleep" or "Do nothing". Third, check whether your laptop is set to stay on when plugged in; some Windows laptops have different settings for battery and plugged-in modes.
On Windows, if the setting is correct but the lock still is not working, restart your laptop and try again. On a Mac, if the lock screen does not appear when you open the lid, make sure the "Require password" toggle in Lock Screen settings is turned on (blue). If it is off, the laptop will not lock even if sleep is active.
Frequently Asked Questions
Will my laptop lock if I just close the lid without shutting it down?
Yes. Closing the lid triggers the lock setting whether the laptop is running or in sleep mode. You do not need to shut down or log out. The lock happens automatically based on the power setting you chose.
Can someone wake my laptop without entering a PIN?
No. When the lock is active, opening the lid or pressing a key will wake the laptop, but the login screen will appear when ready. The person must enter your PIN or password to access anything. If they can access your laptop without a PIN, the lock setting is not turned on.
What if I forget my PIN after setting the lock?
On Windows, you can reset your PIN through the login screen by clicking "I forgot my PIN" and answering security questions or using a recovery email. On a Mac, you can reset your password using your Apple ID or a recovery key if you set one up. If you cannot reset it, you may need to contact Apple or Microsoft support or take the laptop to a technician.
Does the lock drain my battery faster?
No. Locking the screen uses less power than keeping the display on. The lock feature works with sleep mode, which is designed to use minimal battery while keeping your laptop ready to wake quickly.
Can I set different lock times for battery and plugged-in modes?
Yes, on Windows. In Power Settings, you can set "When I close my lid" separately for battery and plugged-in modes. Click the dropdown next to "On battery" and "Plugged in" to choose different actions. On a Mac, the setting applies to both modes equally.