The fastest way back in depends on what you remember

If you've forgotten your password, the path forward depends on whether you're using Windows or Mac, and whether you set up a recovery method beforehand. Windows lets you reset through a Microsoft account or a local recovery key if you prepared one. Mac requires your Apple ID or a recovery code you saved earlier. If you set up neither, you'll need to reinstall the operating system, which erases your files — so the first step is always to check what recovery options you actually have available.

The good news: you don't need to call the manufacturer or pay anyone. The bad news: if you didn't prepare a recovery method, the process takes longer and carries real risk of data loss. Start by identifying your operating system and what you remember about your account setup.

Key Takeaways

  • Windows computers linked to a Microsoft account can be reset through the login screen using your email and a recovery code sent to your phone or backup email.
  • Mac computers require your Apple ID password or a recovery code you created during setup — without either, you must reinstall the operating system.
  • If you set up a local Windows account with no Microsoft connection, you need a password reset disk created before you forgot the password, or you must reinstall Windows.
  • Reinstalling your operating system erases all files on the drive unless you have a backup, so recovery through your account should be your first attempt.
  • The entire process from locked screen to working computer typically takes 15 minutes to an hour if you have recovery information, or several hours if you need to reinstall.

Resetting a Windows password through your Microsoft account

If your Windows computer is connected to a Microsoft account (the email address you use to sign in), you can reset your password from the login screen without opening the computer. On the login screen, click "I forgot my password" beneath the password field. Windows will ask you to verify your identity by sending a code to your phone number or backup email address.

Check the phone or email where Microsoft sends the code. Enter that code back into the login screen, then create a new password. Use something you can remember this time, or write it down and store it somewhere find — a notebook in a drawer, not a sticky note on the monitor. Once you've entered the new password twice to confirm it, click Next and wait for Windows to verify the change. You should be back at the login screen within a minute, ready to sign in with your new password.

This method works only if you have access to the phone number or email address Microsoft has on file. If you no longer have access to that recovery method, you'll need to use a different approach.

Resetting a Windows password with a recovery key

If you created a recovery key when you first set up Windows (or at any point afterward), you can use it to reset your password without needing access to your email or phone. The recovery key is a long string of characters that looks like this: 123456-789012-345678-901234-567890-123456. If you saved this key in a file, email, or printed it out, retrieve it now.

On the locked login screen, click "I forgot my password," then select "Use a recovery key instead." Paste or type your recovery key into the field, then create your new password. Windows will verify the key and let you in. If you can't find your recovery key anywhere, move to the next section.

Resetting a Mac password using your Apple ID

On a Mac, if you set up your account with an Apple ID, you can reset your password from the login screen. Click the question mark icon or wait for the login screen to show password hints. After several failed attempts, macOS will offer you the option to reset using your Apple ID. Click that option, then enter your Apple ID email and password.

macOS will verify your identity and let you create a new login password. This new password is separate from your Apple ID password — you're only resetting the password you use to unlock your Mac. Once you've entered the new password twice, click the arrow or press Enter, and you should be able to log in.

If you don't remember your Apple ID password either, you'll need to reset that first on a different device or computer by visiting Apple's account page. Once you've regained access to your Apple ID, come back to your Mac and use the method above.

Using a Mac recovery code if you saved one

When you first set up your Mac or enabled FileVault encryption, Apple gave you a recovery code — a long string of characters you were asked to write down or save. If you have this code, you can use it to reset your password without needing your Apple ID.

On the login screen, click the question mark or wait for the password hint to appear. Select "Reset Password" or "Forgot Password," then choose "Use Recovery Code." Enter your recovery code, create a new password, and click Next. Your Mac will verify the code and let you in. If you didn't save your recovery code and don't remember your Apple ID password, you'll need to reinstall macOS, which requires erasing your drive.

What to do if you have no recovery method set up

If you didn't set up a Microsoft account on Windows, didn't create a recovery key, and can't access your email or phone, or if you're on a Mac without a recovery code or Apple ID access, you'll need to reinstall your operating system. This erases everything on your computer — all files, programs, and settings — unless you have a backup on an external drive or cloud storage.

Before you start, check whether you have a backup. If your files are backed up to an external hard drive, cloud storage like OneDrive or iCloud, or another computer, you can restore them after reinstalling. If you have no backup and no way to recover your password, you face a choice: reinstall and lose your files, or take the computer to a repair shop and pay them to attempt recovery (which may or may not work).

If you decide to reinstall, you'll need another computer to read the Windows or macOS installer onto a USB drive, then boot your locked computer from that drive. The process takes 30 minutes to two hours depending on your internet speed and how much data was on the drive. Instructions for creating installation media are on Microsoft's and Apple's websites respectively.

Preventing this from happening again

Once you're back in your computer, take 10 minutes to set up recovery options so you never face this situation again. On Windows, go to Settings, then Accounts, then "Security options" and add a recovery email and phone number to your Microsoft account. On Mac, go to System Settings, then General, then "Transfer or Reset," and write down your recovery code in a safe place — a notebook, a password manager, or a find note in your email.

Consider using a password manager like Bitwarden, 1Password, or KeePass to store your passwords. These programs keep all your passwords in one encrypted file protected by a single strong password. If you forget that one password, you can still recover your account through your email or phone. Password managers also generate strong passwords for you, so you don't have to remember them.

Frequently Asked Questions

Can I reset my password if I don't have internet access?

On Windows, you need internet to send and receive the recovery code, so you'll need to connect to Wi-Fi or use a mobile hotspot. On Mac, you can use a recovery code offline, but if you don't have one, you'll need internet to verify your Apple ID. If you have neither internet nor a recovery method, you'll need to reinstall your operating system.

What if I remember part of my password but not all of it?

Windows and Mac don't have a "hint" system that lets you recover a partial password. You'll need to use one of the full recovery methods described above — Microsoft account reset, recovery key, Apple ID, or recovery code. There's no way to guess or partially recover a forgotten password.

Will resetting my password delete my files?

No. Resetting your password through your Microsoft account, recovery key, Apple ID, or recovery code only changes your login password. All your files, programs, and settings stay exactly where they are. Only reinstalling the operating system erases your files.

How long does it take to get back into my computer?

If you have a recovery method set up, you'll be back in within 5 to 15 minutes. If you need to reinstall your operating system, plan for 1 to 3 hours depending on your internet speed and how much data needs to be erased and rewritten.

Can a repair shop recover my password?

No shop can recover a forgotten password — passwords are encrypted and can't be read even by the manufacturer. What they can do is reinstall your operating system (which you can do yourself) or attempt data recovery if your files are important and you're willing to pay several hundred dollars. For most situations, using your recovery method or reinstalling yourself is faster and cheaper.