The fastest way depends on what locked your computer
If you forgot your password, the route forward depends on whether you use Windows, macOS, or Linux, and whether your account is local or tied to Microsoft or Apple. If your computer is frozen or unresponsive but not password-protected, the fix is usually a hard restart. If someone else locked it or it's a work machine, you'll need to contact your IT department or the person who set it up.
The steps below cover the most common scenarios. Start by identifying which one matches your situation, then follow the path for your operating system.
Key Takeaways
- Windows users with a Microsoft account can reset their password from the login screen using a recovery email or phone number without losing files.
- macOS users can reset a forgotten password using another admin account, Apple ID, or Recovery Mode, depending on what you have access to.
- If your computer is frozen but not locked by password, hold the power button for 10 to 15 seconds to force a shutdown, then restart normally.
- Work or school computers usually require contacting IT support, as they have restrictions that prevent standard password reset methods.
- A hard restart should always be your first step if the computer is unresponsive or the screen won't wake from sleep.
Windows: Resetting a forgotten password
If you're at the Windows login screen and don't remember your password, look for the "I forgot my password" link below the password field. Click it. Windows will ask you to verify your identity using a recovery email address or phone number tied to your Microsoft account. You'll receive a code, enter it, and then create a new password. This method keeps all your files intact.
If you don't see that link, or if your account is local (not connected to Microsoft), you have fewer options. You can restart the computer in Safe Mode by holding Shift while clicking the restart button, then try a blank password or a password you used previously. If that doesn't work, you'll need another admin account on the same computer to reset the password, or you'll need to reinstall Windows from a USB drive, which will erase your files.
For work or school computers, contact your IT helpdesk before trying anything else. They may have tools to reset your password remotely without you losing access to network drives or email.
macOS: Unlocking when you've forgotten the password
If you have another admin account on the same Mac, log in with that account, open System Settings, go to General > Users & Groups (or Users & Accounts on older versions), select your account, and click the lock icon to make changes. Then click "Reset Password" and create a new one.
If you don't have another admin account, you can use your Apple ID. At the login screen, click the question mark or wait for the hint to appear, then click "Reset it in iCloud" or "Reset using your Apple ID". You'll sign in with your Apple ID and create a new password. Your files stay on the computer.
If neither of those works, restart your Mac in Recovery Mode by holding Command and R while it boots. Once in Recovery Mode, open Utilities > Terminal and type resetpassword, then press Enter. This opens the password reset tool. Select your account and create a new password. After you restart, you'll be able to log in.
Frozen or unresponsive computer
If your screen is frozen, an process won't close, or the computer won't wake from sleep, a hard restart is usually the first fix. Hold the power button down for 10 to 15 seconds until the screen goes black and the computer shuts down completely. Wait a few seconds, then press the power button once to turn it back on.
On a Mac, you can also try pressing Command + Option + Esc to open the Force Quit window, select the frozen process, and click "Force Quit". This closes the problem program without restarting the whole machine. On Windows, try Ctrl + Shift + Esc to open Task Manager, find the frozen program, select it, and click "End Task".
If the computer still won't respond after a hard restart, and you see error messages or a black screen, the problem may be a hardware issue or a corrupted system file. At that point, you may need to boot from a recovery drive or contact a technician.
Work or school computers
If the computer is managed by an employer or school, password resets usually go through your IT department, not through the standard Windows or macOS recovery methods. Look for an IT helpdesk number or email in your onboarding materials, on the login screen itself, or on your organization's intranet.
When you contact them, have your employee or student ID ready. They may ask you to verify your identity by answering security questions or confirming your email address. Some organizations can reset your password while you wait on the phone; others may take a few hours. In the meantime, ask whether there's a temporary password they can give you to log in.
Preventing lockouts in the future
Set up a recovery email address and phone number in your account settings now, before you need them. On Windows, go to Settings > Accounts > Security Options. On macOS, go to System Settings > General > Users & Groups, select your account, and add a recovery email under "Password" or "Login Options".
If you use a password manager like Bitwarden, 1Password, or KeePass, store your computer password there along with a backup of your recovery codes. Write down your recovery email and phone number and keep them in a safe place. If you ever get locked out, you'll have a way back in without losing your files or paying for help.
Frequently Asked Questions
Can I unlock my computer without knowing the password?
Yes, if you have access to a recovery email, phone number, or another admin account. Windows and macOS both offer password reset options at the login screen. If none of those work, you can boot into Recovery Mode on macOS or Safe Mode on Windows and use built-in tools to reset the password. Work computers require IT support.
What happens to my files if I reset my password?
Your files stay on the computer. Password resets don't erase anything. The only exception is if you reinstall the operating system from scratch, which does erase the drive. Avoid that route unless you've backed up your files first.
How long does it take to unlock a work computer?
It depends on your IT department. Some can reset your password in minutes while you're on the phone. Others may take a few hours or a business day. Contact them as soon as you realize you're locked out so they can prioritize your request.
What if I see a message saying my account is locked?
On Windows, this usually means you've entered the wrong password too many times. Wait 15 to 30 minutes and try again, or use the password reset option. On a work computer, contact IT — they may have locked it intentionally for security reasons.
Can I unlock someone else's computer?
Not without their permission or credentials. If it's a family member's computer, ask them for their password or recovery information. If it's a work computer that belongs to your employer, only IT can unlock it. Attempting to bypass someone else's password without permission is illegal.