The fastest way depends on whether you remember any password at all

If you are locked out of your computer entirely, you have three realistic paths: use a password reset disk you made before, answer security questions you set up with Microsoft or Apple, or reinstall the operating system. If you remember your password but forgot it, you can reset it through your account settings without losing your files. The method that works for you depends on what you prepared ahead of time and which operating system you use.

Do not buy "password recovery" software online. Most of it does not work on modern Windows or Mac systems, and some contains malware. The methods below are free and come directly from Microsoft and Apple.

Key Takeaways

  • Windows lets you reset a forgotten password through your Microsoft account email or phone number if you set that up before you got locked out.
  • Mac requires either a recovery key you saved earlier, your Apple ID, or a second administrator account on the same computer.
  • A password reset disk (Windows) or recovery key (Mac) made months ago is often your fastest option if you have it.
  • If you have no recovery method set up and cannot remember the password, reinstalling the operating system is the only reliable option, and it erases your files.

Windows: Reset through your Microsoft account

If you use a Microsoft account to sign in (not a local account), you can reset your password from the login screen without needing anything else. At the login screen, click "I forgot my password." Windows will ask you to verify your identity using your phone number or backup email address — whichever you registered with Microsoft. You will receive a code, enter it, and then create a new password.

This works only if you set up a phone number or backup email with your Microsoft account before you got locked out. If you did not, you cannot use this method. You can check whether you have a backup email or phone set up by going to account.microsoft.com on another device and signing in with your Microsoft account.

If you have a local account (not a Microsoft account), this method does not work. A local account is stored only on your computer, not in the cloud.

Windows: Use a password reset disk

If you created a password reset disk before you forgot your password, you can use it now. Insert the USB drive or disk into your computer, click "I forgot my password" at the login screen, and follow the prompts. The reset disk will let you create a new password without losing any files.

If you did not make a reset disk before, you cannot make one now — you need administrator access to create one. This is why making one ahead of time matters.

Mac: Use your recovery key or Apple ID

If you set up two-factor authentication on your Apple ID before you got locked out, Apple gave you a recovery key — a long string of numbers and letters. If you saved that key, you can use it to reset your password. Restart your Mac and hold Command-Option-R to enter Recovery Mode. Click "Reset Password," select your account, and enter your recovery key. Then create a new password.

If you do not have your recovery key but you remember your Apple ID and password, you can use those instead. Follow the same steps to enter Recovery Mode, but select "Reset Password" and choose to verify with your Apple ID. Apple will send a code to a trusted device, you enter it, and then you can create a new password.

If you have a second administrator account on the same Mac, you can sign in with that account and reset the forgotten password through System Settings. Open System Settings, go to General, then Users & Groups (or Accounts on older Macs), select the account with the forgotten password, and click "Reset Password."

What to do if you have no recovery method

If you have no password reset disk, no recovery key, no backup email or phone on your Microsoft account, and no second administrator account, reinstalling the operating system is your only option. This erases everything on your computer — all files, programs, and settings.

For Windows, you will need a USB drive and access to another computer. Go to microsoft.com/software-read/windows on the other computer, read the Windows installation tool, and follow the prompts to create a bootable USB drive. Insert it into your locked computer, restart, and boot from the USB drive. Choose "Repair your computer," then "Troubleshoot," then "Reset this PC." Select "Remove everything." This will reinstall Windows and let you create a new administrator account, but your old files will be gone.

For Mac, restart while holding Command-R to enter Recovery Mode. Click Utilities, then Terminal. Type resetpassword and press Enter. This opens the password reset tool without requiring your old password. Create a new administrator account. Your old files remain, but you will not be able to access the old account.

How to prevent this from happening again

Make a password reset disk now if you use Windows. Go to Settings, search for "password reset disk," and follow the wizard. Use a USB drive you label clearly and store somewhere safe. Do the same thing every few years in case your disk fails.

If you use Mac, turn on two-factor authentication for your Apple ID and save your recovery key in a safe place — not on your computer. Go to appleid.apple.com, sign in, click "Security," and follow the prompts. Write down your recovery key or save it in a password manager.

For both systems, set up a backup email address or phone number with your account. This takes five minutes and can save you hours later.

Frequently Asked Questions

Can I reset my password if I remember the old one?

Yes. On Windows, go to Settings, Accounts, "Your info," and click "Manage your Microsoft account." On Mac, go to System Settings, General, Users & Groups, select your account, and click "Change Password." You will need to enter your old password to create a new one.

What if I use my computer for work and my company manages it?

Your company's IT department controls the password policy. Contact them directly — they can reset your password or unlock your account. Do not try the methods above, as they may conflict with company security settings.

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

No. Modern Windows and Mac systems do not have a bypass. Anyone claiming to sell you a bypass tool is selling malware. The methods in this guide are the only legitimate options.

If I reset my password, will I lose my files?

No, unless you reinstall the operating system. A password reset through your Microsoft account, Apple ID, recovery key, or a second administrator account keeps all your files intact. Only a full operating system reinstall erases everything.

How often should I update my password reset disk or recovery key?

Once every one to two years is reasonable. If you change your password frequently, update your reset disk or recovery key at the same time. If you rarely change your password, once a year is enough.