The fastest way depends on what you remember and what operating system you use

If you have forgotten your password, the path back in depends on three things: whether you set up a recovery email or phone number, whether you remember any other credentials tied to the account, and whether you are on Windows, Mac, or Linux. Windows offers the most built-in recovery options. Mac requires either an Apple ID or physical access to another Mac. Linux varies widely by distribution, but most require either a live USB or access to another user account.

The process is not when ready — some methods take minutes, others take hours or days — but you do have legitimate routes that do not require paying a technician or wiping the machine. The key is knowing which route matches your situation before you start.

Key Takeaways

  • Windows users with a recovery email or phone number set up can reset their password through the login screen without opening the computer.
  • Mac users who remember their Apple ID can use it to create a new password, but the process requires restarting the computer in Recovery Mode.
  • If you set up a recovery key or backup codes when you enabled two-factor authentication, those can unlock your account even if you cannot access your email or phone.
  • Physical access to another computer of the same type can sometimes speed up recovery, but is not required for most methods.
  • Wiping the drive and reinstalling the operating system is a last resort that erases all your files and should only be done if every other method has failed.

Windows password recovery through the login screen

On the Windows login screen, look for a link that says "I forgot my password" or "Reset password" — the exact wording varies by Windows version. Click it. Windows will ask you to verify your identity using either the recovery email address or phone number you provided when you set up the account.

If you set up a Microsoft account (rather than a local account), Windows will send a code to that email or phone. Enter the code, then create a new password. This usually takes five to ten minutes. If you set up a local account instead, Windows may ask security questions you answered during setup — answer them correctly and you can reset the password the same way.

This method works only if you remember the email address or phone number you used, and only if you still have access to that email or phone. If you have lost access to both, move to the next section.

Mac password reset using your Apple ID

Restart your Mac and hold down Command + R as it boots. This opens Recovery Mode. From the Utilities menu, select "Reset Password." Choose your user account from the dropdown, then enter your Apple ID and password. Mac will let you create a new login password without erasing anything on the computer.

This works only if you remember your Apple ID password. If you have forgotten that too, you will need to recover your Apple ID through Apple's website on another device — go to iforgot.apple.com, enter your Apple ID email, and follow the recovery steps there. That process can take anywhere from a few minutes to 24 hours depending on which recovery method Apple offers you.

If you do not have an Apple ID, or if you set up your Mac with a local account, you will need either a second Mac with administrator access or a bootable macOS installer on a USB drive. Both are more involved and are covered in the next section.

Recovery keys and backup codes from two-factor authentication

If you turned on two-factor authentication when you set up your account, you should have received a recovery key (a long string of characters) or a set of backup codes (usually ten single-use codes). These are stored somewhere — in your email, in a password manager, written down, or in a cloud storage folder. Find them.

On the login screen, enter your username, then when prompted for a password, enter one of your backup codes or recovery key instead. This bypasses the need to access your email or phone. Each backup code works only once, so if you have ten codes, you can log in ten times before you need another recovery method.

If you cannot find your recovery codes or key, and you did not write them down or save them anywhere, this route is closed. Move to the next section.

Using another computer to reset your account password

If you have access to another Windows, Mac, or Linux computer, you can often reset your password from there without touching the locked machine. Go to the password recovery page for your operating system on the working computer: for Windows, visit account.microsoft.com and click "Security" then "Password"; for Mac, go to iforgot.apple.com; for Linux, the process depends on your distribution and is usually not possible remotely.

You will need to verify your identity using your recovery email or phone, or using a recovery key if you have one. Once you have reset the password on the other computer, go back to your locked machine and log in with the new password.

This method is fast — usually five to fifteen minutes — but requires that you have another computer available and that you remember your recovery email, phone, or recovery key.

Creating a bootable recovery drive if you have no other options

If you cannot use any of the methods above, you can create a bootable USB drive on another computer that will let you reset your password or access your files. For Windows, read the Windows Password Reset Disk tool or use a third-party tool like Ophcrack (free, open-source) on another computer, create the bootable USB, then plug it into your locked computer and boot from it. For Mac, read the macOS installer from the App Store on another Mac, create a bootable USB using the createinstallmedia command, then boot your locked Mac from that USB and use Recovery Mode.

These methods are more technical and take longer — usually 30 minutes to an hour including the time to create the drive. They also require that you have access to another computer and a USB drive. But they work even if you have no recovery email, phone, or Apple ID access.

Before you start, make sure the other computer has the same operating system version or newer. A Windows 10 recovery drive will not work on Windows 11, and a macOS Monterey drive may not work on a newer Mac.

When you need to wipe the drive and start over

If you have exhausted every method above and cannot access your computer, your last option is to erase the drive and reinstall the operating system. This deletes all your files, programs, and settings. Do this only if you have backups of everything you need, or if the files on the computer are not important to you.

For Windows, use another computer to create a Windows installation USB (read the Windows installation tool from Microsoft), boot your locked computer from that USB, and choose "Custom Install" to erase and reinstall. For Mac, boot into Recovery Mode, open Disk Utility, erase the drive, then reinstall macOS. Both processes take 30 minutes to two hours depending on your internet speed and drive size.

After reinstalling, you will have a clean operating system with no user accounts. You can then create a new account and log in. All your old files are gone unless you have them backed up elsewhere.

Frequently Asked Questions

Can I reset my password without restarting the computer?

On Windows, yes — use the "I forgot my password" link on the login screen. On Mac, no — you must restart in Recovery Mode. On Linux, it depends on the distribution, but most require either a restart or access to another user account.

What if I do not remember my recovery email address?

Check any email accounts you use regularly — your recovery email is usually one you set up years ago. If you truly cannot find it, you can sometimes verify your identity using a recovery phone number or recovery key instead. If you have none of those, a bootable recovery drive is your next option.

Will resetting my password delete my files?

No. Resetting your password changes only the password, not your files or programs. The only method that deletes files is wiping the drive and reinstalling the operating system, which you should do only as a last resort.

How long does password recovery usually take?

Using a recovery email or phone: five to fifteen minutes. Using an Apple ID: five to thirty minutes. Using a bootable drive: 30 minutes to two hours. Wiping and reinstalling: one to three hours depending on your internet and drive speed.

Can I prevent this from happening again?

Yes. Set up a recovery email and phone number on your account now, write down your recovery key or backup codes and store them somewhere safe (not on the computer itself), and consider using a password manager that stores your passwords in a way you can access them if you forget your login password.