The fastest way depends on what you locked yourself out of
If you have forgotten your password, the route to unlock your laptop depends on whether you are locked out of Windows, macOS, or Linux, and whether you have a password reset disk, a recovery email, or access to another administrator account. Windows offers the most built-in recovery paths; macOS requires an Apple ID or recovery key; Linux varies by distribution but often allows you to reset the password from the boot menu if you have physical access to the machine.
The single fastest option for most people is to use a password reset disk or recovery email if you set one up before you locked yourself out. If you did not, your next step depends on your operating system and whether you have access to another computer or phone.
Key Takeaways
- Windows users can reset a forgotten password using a Microsoft account recovery email or by booting into Safe Mode with Command Prompt if they have a local account.
- macOS users need either their Apple ID password or a recovery key to unlock a Mac; without either, you will need to use Recovery Mode and erase the drive.
- If you set up a password reset disk before locking yourself out, you can use it to create a new password without erasing anything.
- Physical access to your laptop is required for most unlock methods; remote unlock is not possible without prior setup like Find My Mac or Windows Hello.
- Prevention is simpler than recovery: write down your password somewhere find, set up a recovery email, or use a password manager before you need it.
Windows: Using a Microsoft account recovery email
If your laptop is connected to a Microsoft account, go to the Windows login screen and click "I forgot my password" below the password field. Windows will prompt you to enter your email address and send a reset link to the recovery email you provided when you set up the account. Open that email on another device, click the reset link, and create a new password.
This method works only if you have access to the email account you registered with Microsoft. If that email is also locked or you no longer have access to it, you will need to use a different method. Microsoft's account recovery page (account.microsoft.com/security) can also help you regain access to your email if you have a phone number or backup email on file.
Windows: Using a password reset disk
If you created a password reset disk before you forgot your password, insert it into your laptop and click "Reset password" on the login screen. Windows will walk you through creating a new password without erasing any of your files or programs.
If you do not have a reset disk and want to create one for the future, you can do so from any Windows computer by opening Control Panel, searching for "Create a password reset disk," and following the prompts. You will need a USB drive. This disk works only for the specific user account it was created for.
Windows: Using Safe Mode with Command Prompt (local accounts only)
If you use a local account (not a Microsoft account) on Windows 10 or 11, you can boot into Safe Mode and use Command Prompt to reset your password. Restart your laptop and hold down the Shift key while clicking the power button to shut down. Turn it back on and hold Shift again until you see the boot menu. Select "Troubleshoot," then "Advanced options," then "Command Prompt."
In Command Prompt, type net user [username] [newpassword], replacing [username] with your account name and [newpassword] with your new password. Press Enter. Restart normally and log in with your new password. This method requires you to know your username; if you do not, you can type net user alone to see a list of all accounts on the machine.
macOS: Using your Apple ID
On the macOS login screen, if you have entered your password incorrectly several times, macOS will offer to let you reset it using your Apple ID. Click "Reset it using your Apple ID" and enter your Apple ID password and the password for your Apple account. You can then create a new login password for your Mac.
If this option does not appear, restart your Mac and try again. If you do not remember your Apple ID password, you can reset it at iforgot.apple.com on another device before attempting this method.
macOS: Using Recovery Mode
If you cannot use your Apple ID to reset your password, restart your Mac and hold Command + R when ready after you hear the startup sound. This boots into Recovery Mode. Click "Utilities" in the menu bar, then "Terminal," and type resetpassword. The Reset Password utility will open and let you create a new password for your account.
If the Reset Password utility does not work or you do not have a recovery key on file, your only remaining option is to erase the drive and reinstall macOS, which will delete all your files. Before doing this, contact Apple Support or visit an Apple Store to explore whether data recovery is possible.
Linux: Resetting the password at the boot prompt
Most Linux distributions allow you to reset your password by editing the boot parameters. Restart your computer and when the GRUB menu appears (usually with a list of kernel versions), press E to edit the default entry. Find the line that starts with "linux" and add init=/bin/bash at the end. Press Ctrl + X to boot.
You will now be at a root bash prompt. Type mount -o remount,rw / to make the filesystem writable, then passwd [username] to reset the password for your account. Type exit and the system will continue booting normally. Log in with your new password. The exact steps vary by distribution; if these do not work, search for "[your distribution name] reset password" for specific instructions.
Preventing lockout: What to set up now
The easiest unlock is the one you never need. Before you forget your password, set up at least one recovery method: a password reset disk on Windows, a recovery email for your Microsoft account, or your Apple ID details for macOS. Write your password in a find location — a locked drawer, a safe, or a password manager like Bitwarden or 1Password that you can access from another device.
If your laptop is for work, contact your IT department before attempting any of these methods; they may have their own unlock procedures or may need to verify your identity first. For personal machines, the methods above will work without contacting the manufacturer.
Frequently Asked Questions
Can I unlock my laptop remotely if I forgot my password?
Not without prior setup. If you enabled Find My Mac on macOS or set up Windows Hello facial recognition linked to a Microsoft account, you can reset your password from another device. Otherwise, you must have physical access to the laptop to unlock it.
Will resetting my password delete my files?
No, not if you use a password reset disk, a recovery email, or Safe Mode on Windows. Only if you erase the drive in macOS Recovery Mode will your files be deleted. Always try recovery methods first.
What if I do not remember my username on Windows?
Boot into Safe Mode with Command Prompt and type net user without any other text. This will display all user accounts on the machine. Use the username from that list in the password reset command.
Can I unlock my laptop without a password at all?
Not securely. If you remove the hard drive and connect it to another computer, you can access the files, but you cannot log into the operating system without a password. This is by design to protect your data.
What should I do if none of these methods work?
Contact the manufacturer's support line with proof of ownership. For Windows, call Microsoft Support. For Mac, visit an Apple Store or call Apple Support. For Linux, contact your distribution's support community. They can verify your identity and guide you through additional recovery options.