The fastest way depends on what locked you out

If you forgot your password, the path forward depends on whether you use Windows, macOS, or Linux, and whether you set up a recovery method beforehand. If your computer locked itself because you stepped away, you can usually unlock it by typing your password at the lock screen. If someone else locked it or you cannot remember the password at all, the process takes longer and may require reinstalling your operating system.

The methods below assume you own the computer and have the right to access it. If you are trying to access someone else's device, you will need their permission and their recovery information.

Key Takeaways

  • On Windows, a forgotten password can be reset using a Microsoft account recovery email or phone number, or by using a password reset disk if you created one before you locked yourself out.
  • On macOS, you can reset your password using your Apple ID, a recovery key, or by booting into Recovery Mode and creating a new administrator account.
  • If you have no recovery method set up, you will need to reinstall your operating system, which erases all files on the drive.
  • The fastest unlock is typing your password at the lock screen; the slowest is a full reinstall, which can take two to four hours depending on your internet speed and drive size.
  • Setting up a recovery email, phone number, or backup codes now prevents this problem later.

Unlocking Windows when you know your password

If your computer is locked but you remember your password, press Ctrl + Alt + Delete on the keyboard. A menu will appear with options including "Lock", "Switch user", and "Sign out". Click "Sign out" or wait for the lock screen to appear, then type your password and press Enter.

If you are at the Windows login screen and your account appears, straightforward type your password into the field below your username and press Enter. If multiple accounts are shown, click your account first, then enter your password.

If the keyboard does not respond, try restarting your computer by holding the power button for ten seconds, then turning it back on. This is slower but will return you to the login screen.

Resetting a forgotten Windows password

At the Windows login screen, click "I forgot my password" below the password field. Windows will ask you to verify your identity using either a recovery email address or a phone number you registered with your Microsoft account. Check your email or phone for a code, enter it on the screen, and you will be able to set a new password.

This method works only if you linked your Windows account to a Microsoft account before you locked yourself out. If you set up a local account with no Microsoft email attached, this option will not appear.

If you created a password reset disk on a USB drive before you forgot your password, insert that drive into your computer. At the login screen, click "Reset password", then follow the prompts to use the disk to create a new password. This is faster than waiting for email recovery and does not require internet access.

Resetting a forgotten Windows password without recovery options

If you have no recovery email, no phone number on file, and no reset disk, you will need to reinstall Windows. This erases all files on your computer, so use this only as a last resort. read the Windows installation tool on another computer from Microsoft's website, create a bootable USB drive following their instructions, and insert it into your locked computer.

Restart your computer and press the key that opens the boot menu — usually F12, F2, Esc, or Del, depending on your computer's manufacturer. Select the USB drive from the menu. Follow the Windows installation prompts, choose "Custom install", and select your main drive to erase and reinstall. The process takes one to three hours depending on your internet speed.

Unlocking macOS when you know your password

If your Mac is locked, press any key or move the mouse to wake the screen. Type your password into the field and press Enter. If you see a message asking for your Apple ID password instead, enter that password — Apple IDs are linked to your Mac account.

If you are at the login screen and your account does not appear, click "Other" at the bottom left, then enter your username and password.

Resetting a forgotten macOS password

Restart your Mac and hold Command + R while it boots to enter Recovery Mode. Once the recovery menu appears, click "Utilities" in the menu bar, then select "Reset Password". Choose your account from the dropdown, then create a new password and click "Save".

If you linked your Mac to an Apple ID before you locked yourself out, you can also restart your Mac, wait for the login screen, and click "Reset password" below the password field. Enter your Apple ID email and password, then set a new Mac password.

If you have a recovery key from your Apple ID, you can use that instead of your Apple ID password. Recovery keys are long codes you can read from your Apple ID account page.

Resetting a forgotten macOS password without recovery options

If you have no Apple ID linked to your Mac and no recovery key, restart your Mac and hold Command + R to enter Recovery Mode. Click "Utilities", then "Terminal". Type resetpassword and press Enter to open the password reset tool. Select your account and create a new password.

If that does not work, you will need to reinstall macOS. In Recovery Mode, click "Reinstall macOS" and follow the prompts. This erases your drive, so back up your files first if possible. The reinstall takes one to four hours.

Unlocking Linux

If your Linux computer is locked, type your password at the lock screen prompt. If you forgot your password, restart your computer and hold Shift while it boots to enter GRUB (the boot menu). Select your Linux version, then press e to edit the boot command. Find the line that starts with "linux" and add init=/bin/bash at the end. Press Ctrl + X to boot.

Once the system boots to a command prompt, type mount -o remount,rw / to make the filesystem writable, then type passwd username (replace "username" with your account name). Enter a new password twice and press Enter. Restart your computer by typing reboot. You can now log in with your new password.

This method works on most Linux distributions, but the exact steps vary. If the above does not work, search for "[your Linux distribution name] reset password" for distribution-specific instructions.

Frequently Asked Questions

Can I unlock my computer without knowing the password?

Not without erasing your files. If you have no recovery email, phone number, recovery key, or reset disk, you will need to reinstall your operating system, which deletes everything on the drive. This is why setting up recovery options now prevents problems later.

What if I see a message saying my account is locked?

This usually means you entered the wrong password too many times. Wait 15 to 30 minutes and try again. If the message persists, restart your computer and try once more. If you still cannot log in, use the password recovery method for your operating system.

Can I unlock someone else's computer?

Not without their permission and their recovery information. If you need access to a family member's computer, ask them for their password or recovery email. If the owner has passed away or is unavailable, contact the computer manufacturer with proof of ownership.

How long does a full reinstall take?

One to four hours, depending on your internet speed, the size of your drive, and your computer's age. Newer computers with fast internet connections reinstall in one to two hours. Older computers or slow connections can take three to four hours.

Will I lose my files if I reinstall?

Yes. Reinstalling your operating system erases the entire drive. If you have an external backup or cloud storage with copies of your files, you can restore them after reinstalling. If not, the files are gone.