Set your laptop to lock automatically when you shut it

When you close your laptop lid, you can make it lock immediately instead of staying awake. This means anyone who picks up your closed laptop cannot use it without entering your password. The setting lives in your power and sleep options, and the steps differ slightly between Windows and Mac.

On Windows, you control this through Settings. On a Mac, the setting is in System Settings under Lock Screen. Both let you choose whether the laptop locks right away or after a delay — useful if you step away for a moment but plan to come back quickly.

Key Takeaways

  • Windows lets you require a password when the laptop wakes from sleep, which happens when you open the lid.
  • Mac users can set the lock screen to appear immediately or after a delay when the laptop goes to sleep.
  • You can also require a PIN or password to wake the laptop from sleep, adding a second layer of security.
  • The fastest method on either system takes under two minutes and requires no additional software.

Windows: Require a password when the laptop wakes

On Windows 10 and Windows 11, closing the lid puts the laptop to sleep. To lock it so a password is needed when you open it again, go to Settings and find the power settings.

Open Settings by pressing the Windows key and typing "Settings", then press Enter. Click on "System" in the left menu, then "Power and battery" (Windows 11) or "Power and sleep" (Windows 10). Scroll down and click "Screen and sleep" or "Additional power settings". Look for "Require a password on wakeup" or "Require a password when the computer wakes from sleep". Toggle this to On.

Once this is on, closing your laptop lid will put it to sleep, and opening it will show a lock screen. You must enter your Windows password to get back in. If you do not see this option, your laptop may be using a PIN instead of a password — the same protection applies, just with your PIN instead.

Mac: Set the lock screen to appear when the laptop sleeps

On a Mac, closing the lid puts the laptop to sleep automatically. To add a lock screen that requires your password when you open it, go to System Settings and find the Lock Screen options.

Click the Apple menu in the top left corner, then "System Settings". Click "Lock Screen" in the left sidebar. You will see a dropdown that says "Start after [X] minutes of inactivity". Change this to a shorter time — even "1 minute" means the lock screen appears very quickly. Below that, make sure "Require password immediately after sleep or screen saver begins" is toggled On.

Now when you close your Mac, it will sleep and lock. When you open it, the lock screen will appear and ask for your password before you can use it. If you want the lock screen to appear even faster, you can also press Control + Command + Q to lock the screen manually without closing the lid.

Add a PIN requirement for extra security

If your laptop uses a PIN instead of a password, the same lock-on-wake setting protects you. When you close the lid and reopen it, you will need to enter your PIN. On Windows, this is automatic if you have set up a PIN in your account settings. On a Mac, you can only use your account password for the lock screen, not a separate PIN.

If you want to use a PIN on Windows but currently have only a password, you can add one. Go to Settings, click "Accounts", then "Sign-in options". Under "PIN (Windows Hello)", click "Add" and follow the prompts. Once you have a PIN, the lock screen will accept either your PIN or your password when you wake the laptop.

What happens if you do not set this up

Without this setting turned on, closing your laptop lid puts it to sleep, but it does not lock. If someone opens the lid while you are away, they can use your laptop without entering any password or PIN. Your files, email, and any open programs remain accessible.

This is especially risky in shared spaces like offices, libraries, or coffee shops. Even a few minutes away from your desk is enough time for someone to access sensitive information. Turning on the lock-on-wake setting takes less than two minutes and closes this gap completely.

Troubleshooting: The lock screen does not appear

If you have turned on the setting but the lock screen still does not appear when you open the laptop, check that your account actually has a password or PIN set. On Windows, go to Settings, click "Accounts", then "Sign-in options" and look for "Password". On a Mac, go to System Settings, click "General", then "Login Items" and check that your account requires a password at startup.

If you see the lock screen but it accepts your login without a password, your account may not have a password set. Create one in your account settings, and the lock screen will then require it. Also check that you are not using Windows Hello facial recognition or fingerprint login as your only sign-in method — these can sometimes bypass the password requirement on the lock screen.

Frequently Asked Questions

Does closing the lid automatically lock my laptop?

Closing the lid puts the laptop to sleep, but it does not lock unless you turn on the "require password on wakeup" setting. Once that setting is on, opening the lid will show a lock screen that requires your password or PIN before you can use the laptop.

Can I lock my laptop without closing the lid?

Yes. On Windows, press Windows key + L to lock immediately. On a Mac, press Control + Command + Q. Both methods lock the screen without putting the laptop to sleep, so it stays ready to use but inaccessible without your password.

What if I forget my password and the laptop is locked?

On Windows, you can use another admin account to reset the password, or use a Microsoft account to reset it online. On a Mac, you can use your Apple ID to reset your password at the login screen. If neither option works, you will need to contact your IT department or use recovery mode, which is more involved.

Does this setting drain the battery faster?

No. The laptop still goes to sleep when you close the lid, using the same minimal power. The lock screen simply appears when you wake it, adding no battery drain.

Can I set different lock times for different situations?

Windows and Mac both let you set one lock-on-wake time in settings. You cannot create different rules for home versus work. However, you can manually lock your laptop anytime by pressing Windows + L (Windows) or Control + Command + Q (Mac) if you need to lock it faster than the automatic setting.