The fastest way back in depends on what kind of lock you're facing

A locked computer usually means one of three things: you've forgotten your password, your account is temporarily frozen after too many wrong attempts, or your keyboard and mouse aren't responding to unlock the screen. Each has a different fix, and the one you need depends on which situation you're in. The good news is that most locks have a straightforward way out without calling for help.

Before you try anything, take a moment to identify which type of lock you're seeing. Is there a login screen asking for a password? Is the screen black or showing a message? Can you see the desktop but the screen won't wake up? Your answer tells you exactly what to do next.

Key Takeaways

  • A forgotten password on Windows can be reset using another admin account, a password reset disk, or Microsoft account recovery if you know your email address.
  • On a Mac, you can reset a forgotten password using your Apple ID, another admin account, or Recovery Mode if neither of those works.
  • If your screen is locked but you remember your password, press Ctrl+Alt+Delete on Windows or Command+Control+Q on Mac to unlock it.
  • Account lockouts after multiple wrong password attempts usually clear automatically after 15 to 30 minutes, or you can restart your computer to speed this up.
  • If you cannot remember any passwords and have no recovery options set up, you may need to reinstall your operating system, which erases your files.

Unlocking a locked screen when you know your password

If you can see your desktop or a lock screen but your keyboard and mouse aren't working, the computer is likely in sleep mode or has activated a screensaver. On Windows, press Ctrl+Alt+Delete, then click "Sign in" or enter your password at the prompt. On a Mac, press Command+Control+Q to unlock, or if that doesn't work, press any key and enter your password.

If those shortcuts don't work, try moving your mouse or pressing any key on the keyboard. Sometimes the computer needs a nudge to wake up. If the screen stays black, hold down the power button for 10 seconds to force a restart, then log back in normally.

Resetting a forgotten Windows password using another admin account

If you have a second admin account on the same computer, you can reset the forgotten password from that account. Log in with the account you remember, then go to Settings > Accounts > Other people. Find the account you're locked out of, click it, and select "Reset password". You'll be asked to set a new password, which you can then use to log in.

This method works only if you have access to another admin account. If you're the only account holder, move to the next section.

Resetting a Windows password using your Microsoft account

If your Windows account is linked to a Microsoft email address, you can reset your password from any web browser on any device. Go to account.microsoft.com, click "Security" in the left menu, then select "Change password". Enter your email address and follow the steps to verify your identity—Microsoft will send a code to your email or phone. Once you've verified, create a new password and use it to log back into your computer.

This method requires that you remember the email address attached to your account and that you can access that email. If you've forgotten the email address or no longer have access to it, you'll need to use a password reset disk (if you created one before) or reinstall Windows.

Resetting a Mac password using your Apple ID

On a Mac, if you've forgotten your login password, the login screen offers a reset option. At the login screen, click the question mark icon or wait for a prompt asking if you want to reset your password. Click "Reset it" and enter your Apple ID email and password. Apple will send a verification code to a trusted device or phone number. Once you verify, you can set a new Mac password.

If you don't see a reset option on the login screen, restart your Mac and try again. Some older Macs don't show this option, in which case you'll need to use Recovery Mode (see the next section) or reinstall macOS.

Using Recovery Mode on a Mac when other options don't work

If you can't reset your password through your Apple ID, restart your Mac and when ready hold down Command+R until you see the Apple logo. This boots into Recovery Mode. Once you're in Recovery Mode, click "Utilities" in the menu bar, then select "Terminal". Type resetpassword and press Enter. A password reset window will open where you can choose your account and set a new password.

Recovery Mode is a last resort because it requires you to interrupt the startup process at exactly the right moment. If you're not comfortable with this, or if it doesn't work, your only remaining option is to reinstall macOS, which erases your files unless you have a backup.

What to do if your account is temporarily locked after wrong password attempts

After you enter an incorrect password several times in a row, Windows and Mac both lock the account temporarily as a security measure. This lockout usually lasts 15 to 30 minutes. You can wait for the timer to expire, or you can restart your computer to clear the lockout when ready. Once the lockout clears, try your password again—and if you're not sure what it is, use one of the password reset methods above instead of guessing.

If you keep entering the wrong password, you'll trigger the lockout again. Before you try multiple times, make sure you're using the correct keyboard layout (check if Caps Lock is on) and that you're not accidentally typing in a different language.

Reinstalling your operating system as a last resort

If you've exhausted all password recovery options and have no other admin accounts, you can reinstall Windows or macOS. This erases everything on your computer, so only do this if you have backups of your important files or if you're willing to lose them.

On Windows, you'll need a USB drive and another computer to create installation media using the Windows Media Creation Tool. On a Mac, restart and hold Command+R to enter Recovery Mode, then select "Reinstall macOS" from the Utilities menu. Both processes take 30 minutes to an hour. After reinstalling, you'll set up a new account and password from scratch.

Frequently Asked Questions

Can I unlock my computer if I don't remember my password and have no recovery email?

If you have no recovery email, no second admin account, and no password reset disk, your only option is to reinstall your operating system. This erases your files, so it should be a last resort. Before you do this, try asking anyone else who may have used the computer whether they know the password.

What's a password reset disk and how do I use it?

A password reset disk is a USB drive you create in advance on Windows (go to Settings > Accounts > Sign-in options > Password > Create a password reset disk). If you forget your password later, insert the disk at the login screen, click "Reset password", and follow the wizard. If you never created one, you cannot use this method now.

Will restarting my computer erase my files?

No. Restarting clears temporary locks and memory but does not delete files. The only operation that erases files is reinstalling your operating system. If you're just restarting to clear an account lockout or wake up a sleeping screen, your files are safe.

How do I prevent being locked out in the future?

On Windows, create a password reset disk now and store it somewhere safe. On a Mac, make sure your Apple ID is linked to your account and that you have access to the email address. On both systems, write your password somewhere find (a physical notebook, a password manager, or a trusted person) so you have a backup if you forget.

What if I'm locked out of a work computer?

Contact your IT department or help desk when ready. They have tools to reset your password or unlock your account without erasing files. Do not try to reinstall the operating system on a work computer, as it may violate company policy and delete important work files.