Start with the account recovery method you set up before you locked yourself out

The fastest way back into your computer depends on what you prepared ahead of time. When you first created your account, you likely linked a phone number, email address, or security questions to it. That setup is now your lifeline. Check what you have access to right now — your phone, another email account, a recovery code you may have written down.

If you set up two-factor authentication (a second verification step, usually a code texted to your phone), you already have a recovery method in place. If you remember the email or phone number attached to your account, you can use that to reset your password without ever typing the old one. This is the path that works for most people and takes minutes rather than hours.

Key Takeaways

  • Recovery email addresses and phone numbers you set up before the lockout are your fastest way back in — check what you have access to right now.
  • Windows and Mac both offer password reset screens you can reach from the login screen itself, without needing another device.
  • If you cannot remember your recovery email or phone, you will need to prove you own the account through security questions or a recovery code you saved.
  • On a work computer, contact your IT department or help desk first — they may have tools to reset your password without wiping your files.
  • If you have no recovery method set up and no other device to help, a factory reset will let you back in but will erase everything on the computer.

Reset your password on Windows using your recovery email or phone

At the Windows login screen, click "I forgot my password" below the password field. Windows will ask you to enter the email address or phone number you linked to your account when you set it up. If you remember either one, enter it now.

Windows will send a code to that email or phone — check your inbox or text messages. Enter the code on the screen, and you will be prompted to create a new password. Once you do, you can log in with the new password when ready. This method works whether your account is a local account (stored only on your computer) or a Microsoft account (linked to Microsoft's servers).

If you do not remember the recovery email or phone number, Windows will ask you security questions you answered when you set up the account — things like "What was the name of your first pet?" or "What city were you born in?" Answer three of them correctly, and you can reset your password the same way.

Reset your password on Mac using your Apple ID or recovery contact

On the Mac login screen, if you see a question mark icon or a "Reset Password" option, click it. Mac will ask for your Apple ID password — the password you use for the App Store and iCloud. If you remember that password, enter it, and Mac will let you create a new login password for your computer.

If you do not remember your Apple ID password, you can reset that separately at iforgot.apple.com using your Apple ID email address or phone number. Once you have reset your Apple ID password, return to your Mac login screen and use the new Apple ID password to reset your computer password.

If you set up a recovery contact (another person with an Apple device), Mac can send them a code instead. They will receive a notification on their device, and once they approve it, you can reset your password. This requires that person to have their device nearby and to respond to the notification.

What to do if you cannot remember your recovery email, phone, or security answers

If you have no way to verify your identity through email, phone, or security questions, you have reached the point where the computer cannot safely let you back in without additional proof. At this stage, your options narrow.

If this is a work computer, stop and contact your IT department or help desk. They have administrative tools to verify your identity through your employment records and can reset your password without erasing your files. This is always faster and safer than trying to reset it yourself.

If this is your personal computer and you have no recovery method set up, you will need to perform a factory reset. This erases everything on the computer — all files, programs, and settings — and returns it to the state it was in when it left the factory. You will then set up a new account and password from scratch. Before you do this, check whether you have another device (phone, tablet, or another computer) that might have backed up your files to cloud storage like OneDrive, Google Drive, or iCloud.

Factory reset on Windows

At the login screen, hold the Shift key and click the power icon in the bottom right corner. Select "Restart." When the computer restarts, it will show a blue screen with recovery options. Click "Troubleshoot," then "Reset this PC," then "Remove everything." Windows will walk you through the reset process, which takes 30 minutes to an hour depending on your computer's speed.

After the reset completes, you will see the Windows setup screen as if the computer is brand new. Create a new local account with a new password you will remember, or sign in with a Microsoft account. Before you do this, write down your new password somewhere safe — a notebook, a password manager, or a trusted person.

Factory reset on Mac

Restart your Mac and when ready hold Command + R until you see the Apple logo. This boots your Mac into Recovery Mode. Click "Utilities" in the menu bar, then "Terminal." In the Terminal window, type resetpassword and press Enter. A password reset window will open, and you can create a new password for your account.

If that does not work, you can erase the entire drive and reinstall macOS. In Recovery Mode, click "Disk Utility," select your hard drive, and click "Erase." Then click "Reinstall macOS" and follow the prompts. This takes longer than the Windows reset — usually one to two hours — but accomplishes the same thing: a clean slate with a new password you control.

Set up recovery methods now so you do not get locked out again

Once you are back into your computer, take 10 minutes to set up the recovery methods you should have had in place. On Windows, go to Settings > Accounts > Security Options and add a recovery email address and phone number. On Mac, go to System Settings > General > Login Items & Extensions, then click "Edit" next to your account and add a recovery email and phone number.

Write down any recovery codes the system offers you — these are long strings of characters that work as a backup if you lose access to your email and phone. Store the codes somewhere separate from your computer: a notebook in a drawer, a safe, or a trusted family member's house. Do not store them in a file on the same computer, because if you get locked out again, you will not be able to reach that file.

Consider using a password manager like Bitwarden, 1Password, or KeePass to store your passwords in an encrypted vault. These tools let you create strong, unique passwords for each account and remember only one master password. If you forget your master password, you can still recover your account through the password manager's own recovery email — so you end up with two layers of protection instead of one.

Frequently Asked Questions

Can I reset my password without losing my files?

Yes, if you use your recovery email, phone, or security questions. These methods let you create a new password while keeping all your files, programs, and settings intact. A factory reset is the only method that erases everything, and you should only use it if you have no other way to verify your identity.

What if I forgot my Microsoft account password too?

Go to account.microsoft.com/security on another device and click "Can't access your account?" Enter your email address, and Microsoft will send a code to your recovery email or phone. Use that code to reset your Microsoft password, then return to your Windows login screen and use the new password.

Is there a way to bypass my password without resetting it?

No, and any tool or website claiming to do so is either a scam or malware. Password bypass tools do not exist for modern Windows and Mac systems — the encryption is specifically designed to prevent this. The only legitimate paths are recovery email, phone, security questions, or a factory reset.

Can I use someone else's computer to reset my password?

Yes, if you have access to your recovery email or phone. On another computer, go to account.microsoft.com (Windows) or iforgot.apple.com (Mac), enter your email address, and reset your password. Once you have a new password, you can log into your own computer with it. You do not need physical access to your locked computer to reset the password.

What should I do if I think someone else changed my password?

If you believe your account was compromised, reset your password when ready using your recovery email or phone. Then change the passwords for any email accounts linked to your computer account, and check your account activity for unfamiliar sign-ins. On Windows, go to Settings > Accounts > Security Options > Recent Activity. On Mac, go to appleid.apple.com and check "Devices" for unfamiliar computers or phones.