The fastest way depends on whether you remember any password at all
If you can log in as a standard user on your computer, you can reset the administrator password without losing your files or reinstalling Windows or macOS. If you cannot log in at all, your options narrow — you will need either a password reset disk you made earlier, a Microsoft or Apple account linked to the machine, or physical access to reinstall the operating system.
The method that works for you depends on what you set up before you locked yourself out. Most people have at least one path forward, but it requires knowing which one applies to your situation.
Key Takeaways
- On Windows, if you remember any password, log in as a standard user and use Settings to reset the administrator account through your Microsoft account.
- On Mac, use another administrator account or Recovery Mode to reset a forgotten password without erasing the drive.
- A password reset disk created before you forgot the password is the fastest recovery method on either system.
- If you have no other account and no reset disk, you will need to reinstall the operating system, which erases the drive.
- Physical security matters: anyone with access to your computer can reset administrator passwords if you have not enabled firmware passwords or BIOS passwords.
Windows: resetting the password if you can log in as another user
Open Settings (press Windows key + I), then go to Accounts > Other people. Click "Add someone else to this PC" at the bottom. You will be asked for a Microsoft account email and password. Once you add yourself as an administrator, you can use that account to reset the original administrator password.
If you do not have a Microsoft account, create one at account.microsoft.com before you start. It takes a few minutes and requires only an email address and a password you choose. Once you have logged in as the new administrator, go back to Settings > Accounts > Other people, find the original administrator account, click it, then click "Remove". You can now use your new account as the main administrator.
This method works only if you can log in to the computer at all. If you are locked out of every account, move to the password reset disk method below.
Windows: using a password reset disk
If you created a password reset disk before you forgot your password, plug it into the computer. At the Windows login screen, click "Reset password" below the password field. Windows will walk you through creating a new password using the disk.
If you did not create a reset disk and cannot log in to any account, you will need to reinstall Windows. This erases everything on the drive. You can do this by creating a Windows installation USB on another computer (using the Windows Media Creation Tool, free from microsoft.com), then booting from that USB and choosing "Repair your computer" > "Troubleshoot" > "Reset this PC".
Mac: resetting the password with another administrator account
If you have a second administrator account on the Mac, log in with that account. Open System Settings > General > Users & Groups (or System Preferences > Users & Groups on older macOS versions). Click the lock icon at the bottom left and enter the second administrator password. Find the account whose password you forgot, click it, then click "Reset Password" and enter a new one.
If you do not have a second administrator account, you can use Recovery Mode instead. Restart the Mac and hold Command + R until you see the Apple logo. Once in Recovery Mode, go to Utilities > Terminal and type resetpassword, then press Enter. This opens the password reset tool without requiring you to log in.
Mac: using a password reset disk or Apple ID
If you set up a password reset disk on your Mac before forgetting the password, restart the Mac and hold Command + Option + R (or Shift + Option + Command + R on newer Macs). This boots into Internet Recovery. Once the login screen appears, click the question mark icon in the password field, then select your reset disk and follow the prompts.
If your Mac is linked to an Apple ID, you can reset the password at the login screen by clicking "Forgot password?" and answering the security questions or using a recovery key you saved earlier. If you do not remember your Apple ID password, go to iforgot.apple.com on another device to reset that first.
What to do if you have no other account and no reset disk
On Windows, create a bootable USB with Windows installation media on another computer, boot from it, and reinstall Windows. This erases the drive but lets you set a new administrator password from scratch. On Mac, use Internet Recovery (Command + Option + R at startup) to reinstall macOS, which also erases the drive.
Before you erase, check whether you have a Time Machine backup on an external drive. If you do, you can restore your files after reinstalling the operating system. If you do not have a backup and the drive contains files you need, take the computer to a repair shop — they have tools to access the drive without knowing the password, though this costs money and may not be possible on newer encrypted Macs.
Preventing lockout: what to set up now
Create a password reset disk on Windows (Settings > Accounts > Sign-in options > Password > Add) or on Mac (System Settings > General > Users & Groups > Password Options > Create a password hint or reset disk). Store it somewhere safe but separate from your computer — a drawer at home, not next to the machine.
Link a Microsoft account to your Windows machine or an Apple ID to your Mac. Both let you reset your password online if you forget it. On Windows, go to Settings > Accounts > Your info and click "Sign in with a Microsoft account instead". On Mac, go to System Settings > General > Users & Groups and make sure your account is linked to an Apple ID.
If your computer contains sensitive work or financial data, enable a firmware password (Mac) or BIOS password (Windows). This prevents someone from booting into Recovery Mode or installation media to reset passwords without your permission. On Mac, restart, hold Command + Option + R, go to Utilities > Firmware Password Utility. On Windows, restart and press F2 or Del during startup (the key varies by manufacturer) to enter BIOS setup.
Frequently Asked Questions
Can I reset the administrator password without losing my files?
Yes, if you can log in as any other user or if you have a password reset disk. Both methods let you set a new administrator password without touching your files. If you have no other account and no reset disk, reinstalling the operating system erases the drive, but you can restore from a backup afterward if you have one.
What if I do not have a Microsoft account or Apple ID?
Create one before you need it — it takes five minutes. If you are already locked out, you can create an account on another computer, then use it to add yourself as an administrator on the locked machine. If you have no access to another computer, you will need to reinstall the operating system.
Is there a way to reset the password without physical access to the computer?
No. Password reset always requires either logging in locally, booting from external media, or using a recovery account linked to the machine. Remote password reset is not possible because it would be a security hole — anyone could reset your password from anywhere.
How long does it take to reset the administrator password?
If you have a password reset disk or another administrator account, five to ten minutes. If you need to reinstall the operating system, one to two hours depending on your internet speed and drive size.
Should I write my administrator password down somewhere?
Write it in a password manager (like Bitwarden or 1Password) rather than on paper. If you must write it down, store it in a locked drawer separate from your computer. A password reset disk is safer than a written password because it cannot be read without the computer.