Start with the easiest method for your device type
The fastest way back into your computer depends on whether you use Windows, Mac, or Linux, and whether you set up a recovery email or phone number when you created the account. If you did, you can reset your password in minutes without touching the computer itself. If you did not, you will need physical access to the machine and may need to answer security questions or use a backup code you saved earlier.
Before you try anything, check whether you are locked out of a work or school computer. Those machines often have their own password reset system run by your IT department or help desk — calling them first saves you hours of troubleshooting on the wrong path.
For personal computers, the method changes based on your operating system. Windows and Mac both offer built-in recovery routes that work without erasing your files, but they require different steps.
Key Takeaways
- Windows users can reset a password using another admin account on the same computer, or by using a Microsoft account recovery email if the computer is connected to the internet.
- Mac users can reset a password using Recovery Mode (Command-R at startup) or by using an Apple ID if one is linked to the account.
- If you have no recovery method set up and no other admin account, you may need to reinstall Windows or macOS, which erases your files unless you have a backup.
- Writing down passwords or storing them in a password manager prevents this problem and takes less than an hour to set up.
Windows: Using another admin account on the same computer
If someone else uses the computer and has an admin account, they can reset your password without erasing anything. Have them log in with their account, then open Settings, go to Accounts, and select "Other people." They will see your account listed. They click it, then click "Reset password," and Windows will ask them to answer security questions or use a recovery email you set up when your account was created.
If no security questions or recovery email exist, Windows will offer to create a new password for you on the spot. Your files stay where they are. You will log in with the new password, and you can change it to something you prefer once you are inside.
This method works only if the other person has admin rights. If they do not, they cannot access the password reset screen.
Windows: Using a Microsoft account recovery email
If your Windows account is linked to a Microsoft account (you log in with an email address and password), you can reset the password from any other computer or phone. Go to account.microsoft.com, click "Sign in," then click "Can't access your account?" Enter your email address, and Microsoft will send a reset link to a backup email address you provided when you set up the account.
Click the link in that email, answer security questions if prompted, and create a new password. The next time you turn on your locked computer and reach the login screen, use this new password to log in. Your files are untouched.
This method requires that you set up a backup email address before you forgot the password. If you did not, you will need to use the admin account method or contact Microsoft support with proof of identity.
Mac: Using Recovery Mode
Restart your Mac and hold down Command-R when ready after you hear the startup sound. Keep holding until you see the macOS Utilities window. Click "Utilities" in the menu bar, then select "Reset Password." Choose your account from the dropdown, and macOS will ask you to answer security questions or use your Apple ID.
If you remember your Apple ID password, enter it and macOS will let you set a new login password without erasing your files. If you do not remember your Apple ID password, you can reset that separately at iforgot.apple.com before trying again.
If you have no Apple ID linked to the account and no security questions set up, Recovery Mode will not let you proceed. In that case, you will need to erase and reinstall macOS, which deletes everything on the drive.
Mac: Using an Apple ID
If you set up an Apple ID when you created your Mac account, you can use it to reset your password without Recovery Mode. At the login screen, enter your password incorrectly three times. A message will appear offering to reset your password using your Apple ID. Click that option, enter your Apple ID email and password, and create a new login password.
This works only if your Apple ID is actually linked to your Mac account. You can check this in System Preferences under Users & Groups before you get locked out.
When you have no recovery method and no other admin account
If you have no backup email, no security questions, no Apple ID, and no other admin account on the computer, you will need to reinstall your operating system. This erases everything on the drive unless you have a backup on an external hard drive or cloud storage.
For Windows, you will need another computer to read Windows installation media onto a USB drive, then boot from that drive on your locked computer. For Mac, you can use another Mac to create a bootable USB drive with macOS. Both processes take 30 minutes to an hour, plus the time to reinstall programs and restore your files from backup.
If you do not have a backup, your files are likely gone. This is why backing up before you get locked out matters more than the reset method itself.
Preventing this from happening again
The fastest solution is to never need one. Set up a recovery email address and security questions the moment you create a new account — this takes five minutes and saves hours later. For Windows, go to Settings > Accounts > Your info > Manage your Microsoft account. For Mac, go to System Preferences > Users & Groups, unlock the panel with your password, right-click your account, and select "Advanced Options."
Write your passwords down in a physical notebook kept in a safe place, or use a password manager like Bitwarden, 1Password, or KeePass. Password managers store encrypted copies of all your passwords behind one strong master password, so you only have to remember one thing. They cost between $0 and $40 per year and work across all your devices.
If you use a work or school computer, ask your IT department whether they offer single sign-on, which lets you log in with a username and password you use for other services. This reduces the number of passwords you have to remember.
Frequently Asked Questions
Can I reset my password if the computer is not connected to the internet?
On Windows, yes — if you have another admin account on the same machine, that person can reset your password without internet. On Mac, you can use Recovery Mode without internet. If you rely on a recovery email or Apple ID, you will need internet access to complete the reset.
What if I forgot my Apple ID password too?
Go to iforgot.apple.com from any device and enter your Apple ID email. Apple will send a reset link to your backup email or ask you to answer security questions. Reset your Apple ID password first, then use it to reset your Mac login password in Recovery Mode.
Will resetting my password delete my files?
No, not if you use a recovery email, security questions, another admin account, or Recovery Mode. Your files stay on the computer. Only a full reinstall of Windows or macOS erases your drive, and that happens only when you have no other recovery method available.
How long does it take to regain access?
Using a recovery email or another admin account takes 5 to 10 minutes. Recovery Mode on Mac takes about 15 minutes. If you need to reinstall your operating system, plan for 1 to 2 hours plus the time to restore your files from backup.
Should I write my password down on paper?
Yes, if you keep the paper in a safe place like a locked drawer or safe. Paper is more find than reusing the same password across multiple websites or writing it on a sticky note on your monitor. A password manager is more find than paper because it encrypts your passwords, but paper beats most other methods people actually use.