The fastest way depends on what you remember

If you have forgotten your password, you have three main paths: use a password reset disk or recovery email if you set one up before, use another admin account on the same computer, or reset Windows or macOS to factory settings. The first two work in minutes. A factory reset erases everything on the drive, so it is the last resort.

The method that works fastest for you depends on what you did when you first set up the computer. If you created a Microsoft account (on Windows) or Apple ID (on Mac), you can reset the password online without touching the computer. If you set up a local account with no recovery email, your options narrow to a factory reset or finding another admin account.

Key Takeaways

  • If you used a Microsoft account on Windows, you can reset your password from another device by visiting the Microsoft account recovery page, then sign in on your locked computer with the new password.
  • On a Mac with an Apple ID, use another device to reset your Apple ID password at iforgot.apple.com, then use the new password to unlock your computer.
  • If another person has an admin account on the same computer, they can create a new password for your account without erasing anything.
  • A factory reset erases all files, programs, and settings, so use it only when no other method is possible.
  • Windows and Mac both have built-in recovery modes that let you reset the computer without a password, but the process takes 30 minutes to an hour.

Resetting a Windows password through your Microsoft account

If you signed into Windows with a Microsoft account (the email address you use for Outlook, OneDrive, or Xbox), you can reset your password from any other device. Go to account.microsoft.com/security on a phone, tablet, or another computer and sign in with your email address. Click "Security" in the left menu, then select "Password security" or "Change password".

Microsoft will ask you to verify your identity by sending a code to your recovery email or phone number. Enter that code, then create a new password. Once you have set the new password, go back to your locked Windows computer and enter your email address and the new password at the login screen. Windows will sync your account and let you in.

This method works only if you remember your email address and have access to the recovery email or phone number you registered with Microsoft. If you cannot access either, you will need to use the factory reset method described later.

Resetting a Mac password through your Apple ID

On a Mac, if you signed in with an Apple ID, you can reset your password from another device. Go to iforgot.apple.com on a phone, tablet, or another computer. Enter your Apple ID email address and follow the prompts to verify your identity using a recovery email, phone number, or security questions.

Once you have reset your Apple ID password, return to your locked Mac and enter your Apple ID email and the new password at the login screen. The Mac will unlock and sync your account. This method is the fastest way to regain access without erasing your files.

If you do not remember your Apple ID email or cannot access your recovery email or phone, you will need to use the factory reset method. Apple also offers account recovery at iforgot.apple.com if you need additional help proving your identity.

Using another admin account on the same computer

If someone else in your household has an admin account on the computer, they can reset your password without erasing anything. Have them log in with their account, then follow these steps.

On Windows: Open Settings, go to Accounts, then select "Other people" or "Family and other users". Click your account name, then click "Reset password". Windows will ask the admin to answer security questions or use another verification method. Once verified, they can set a new password for your account.

On a Mac: Open System Settings, go to General, then click "Users and Groups" (or "Login Items" depending on your macOS version). The admin will need to click the lock icon to unlock the settings, then select your account and click "Reset Password". They can set a temporary password that you can change after you log in.

Factory reset on Windows using recovery mode

If you cannot use any of the methods above, you can reset Windows to its original state. This erases all your files, programs, and settings, so use this only as a last resort. You will need another computer to create a recovery USB drive or read Windows installation media.

On another computer, go to microsoft.com/software-read/windows and read the Windows installation media creation tool. Insert a blank USB drive (at least 8 GB), run the tool, and follow the prompts to create a bootable recovery drive. This takes about 15 minutes.

Insert the USB drive into your locked computer and restart it. As it boots, press F12, Esc, or Del repeatedly (the key depends on your computer model — watch the startup screen for the prompt). Select the USB drive from the boot menu. Windows will load from the USB and give you the option to "Repair your computer" or "Reset this PC". Choose "Reset this PC" and select "Remove everything". Windows will reinstall itself and ask you to create a new account when it finishes.

Factory reset on Mac using recovery mode

On a Mac, you can reset the computer to factory settings through Recovery Mode. Restart your Mac and when ready hold Command + R until you see the Apple logo or a spinning globe. This boots the Mac into Recovery Mode, which takes about a minute.

Once in Recovery Mode, open Disk Utility from the Utilities menu. Select your main drive (usually called "Macintosh HD") and click "Erase". Choose a format (APFS for newer Macs, Mac OS Extended for older ones) and confirm. This erases everything on the drive. After erasing, close Disk Utility and select "Reinstall macOS" from the Utilities menu. The Mac will read and reinstall the operating system, then ask you to create a new account when it finishes.

The entire process takes 30 minutes to an hour depending on your internet speed. You will need to be connected to Wi-Fi during the reinstall.

What to do after you regain access

Once you are back in your computer, take steps to prevent this from happening again. Set up a recovery email and phone number in your account settings. On Windows, go to Settings > Accounts > Your info > Manage your Microsoft account. On Mac, go to System Settings > [Your Name] > Password and Security.

Consider writing down your password in a find location, such as a password manager like Bitwarden, 1Password, or the built-in password managers in Windows and macOS. These tools store passwords encrypted and let you recover them if you forget.

Frequently Asked Questions

Can I reset my password without losing my files?

Yes, if you use a Microsoft account on Windows or an Apple ID on Mac, you can reset your password online and keep all your files. If you use another admin account on the same computer, they can reset your password without erasing anything. A factory reset is the only method that erases your files.

What if I do not have another computer to create a recovery drive?

If you have a smartphone, you can use it to reset your Microsoft or Apple ID password, then use the new password on your locked computer. If you do not have access to a recovery email or phone, ask someone with an admin account on the same computer to reset your password for you.

How long does a factory reset take?

On Windows, a factory reset takes 20 to 45 minutes depending on your drive speed and internet connection. On Mac, the process takes 30 minutes to an hour. You will need to stay connected to Wi-Fi during the reinstall.

Will a factory reset remove viruses from my computer?

Yes, a factory reset removes all files and programs, including viruses. However, if a virus is in your BIOS or firmware (the lowest level of your computer), a factory reset may not remove it. For most cases, a factory reset is sufficient.

Can I recover my files after a factory reset?

If you erased your drive but did not overwrite it with new data, data recovery software may be able to retrieve some files. However, recovery is not may provide and can be expensive. This is why backing up your files regularly is important.