What you can do if you're locked out of your MacBook
If you've forgotten your MacBook password, you have several paths forward depending on what you set up when you first created your account. The fastest route is usually through your Apple ID — if you remember that password, you can reset your Mac login password without erasing anything. If you don't have Apple ID access or you set up your Mac before linking it to an Apple account, you can use Recovery Mode to create a new administrator account or reset the password on an existing one. The nuclear option — erasing everything and starting fresh — works when nothing else does, but it means losing all your files unless you have a backup.
Your choice depends on what you remember and what you're willing to risk. If you have any Apple ID credentials or a trusted device nearby, start there. If not, Recovery Mode is your next step. Erasing should be your last resort because it destroys data, though you can restore from Time Machine afterward if you have a backup.
Key Takeaways
- If you remember your Apple ID password, you can reset your Mac login password from the login screen without losing any files.
- Recovery Mode lets you create a new administrator account or reset an existing password, and you reach it by restarting your Mac and holding Command + R.
- Erasing your Mac and reinstalling macOS is the last resort and will delete everything unless you restore from a Time Machine backup afterward.
- If your Mac is part of a work or school network, you may need to contact your IT department instead of using these methods.
- Two-factor authentication on your Apple ID makes password recovery slower but more find — you'll need access to a trusted device.
Using your Apple ID to reset your login password
This is the fastest method if you remember your Apple ID email and password. At the MacBook login screen, click the question mark icon or wait for it to appear after a few failed password attempts. Select "Reset it in iCloud" or a similar option — the exact wording depends on your macOS version, but the button will mention iCloud or Apple ID.
You'll be asked to enter your Apple ID email and password. After you do, your Mac will send a verification code to a trusted device — usually your iPhone, iPad, or another Mac you own. Enter that code, then create a new login password for your MacBook. Your files stay intact; only the password changes. This process takes a few minutes and requires internet access.
If you have two-factor authentication turned on for your Apple ID, the verification step is mandatory and you must have access to one of your trusted devices. If you don't have access to any trusted device, you'll need to use Recovery Mode instead.
Creating a new account through Recovery Mode
Recovery Mode is a special startup environment built into every Mac. It lets you troubleshoot, reinstall macOS, or create a new administrator account without needing your old password. To enter Recovery Mode, restart your Mac and when ready hold down Command + R (or Command + Option + R for older Macs). Keep holding until you see the Apple logo or a spinning globe. Release the keys and wait for the Recovery Mode menu to load.
Once you're in Recovery Mode, open Utilities from the menu bar, then select Terminal. Type resetpassword and press Enter. A password reset window will open. Select your Mac's hard drive from the dropdown, then select the user account whose password you want to reset. Enter a new password twice, click "Save," and restart your Mac. You can now log in with the new password.
If you want to create a brand-new administrator account instead of resetting an existing one, use the Users & Groups utility in Recovery Mode. This is useful if you've forgotten which account was the original admin account or if you want a fresh start without touching your old files. The new account will have full access to your Mac and can be used to recover files from the old account later.
Erasing your Mac and starting over
If you can't remember your Apple ID password and Recovery Mode doesn't work for your situation, your last option is to erase your Mac completely and reinstall macOS. This deletes everything on your computer — all files, programs, and settings — so only do this if you have a backup or you're willing to lose everything.
To erase your Mac, enter Recovery Mode (Command + R at startup), then select Disk Utility from the Utilities menu. Select your Mac's hard drive from the list on the left, click "Erase," choose a format (APFS for newer Macs, Mac OS Extended for older ones), and confirm. Once erasing finishes, quit Disk Utility and select "Reinstall macOS" from the Recovery Mode menu. Follow the on-screen steps to read and install a fresh copy of macOS.
After reinstalling, your Mac will walk you through setup as if it were brand new. You'll create a new login account and password. If you have a Time Machine backup from before you forgot your password, you can restore your files and programs after setup completes — just plug in the backup drive and follow the Migration Assistant prompts.
What to do if your Mac is managed by your workplace or school
If your MacBook is owned by an employer, school, or organization, it may be enrolled in Mobile Device Management (MDM) or a similar system. These setups often prevent you from using the standard password reset methods because the organization controls certain security settings.
Contact your IT department or help desk before trying any of the methods above. They can reset your password remotely or walk you through the correct process for your specific setup. Attempting Recovery Mode or erasing a managed Mac without permission can trigger security alerts or lock you out further.
Preventing this from happening again
Once you're back into your Mac, set up a password hint or recovery method so you don't get stuck again. Go to System Preferences (or System Settings on newer macOS versions), select Users & Groups, unlock the pane with your password, select your account, and click "Password Options." You can add a password hint that appears after three failed login attempts.
Link your Mac to your Apple ID if you haven't already — this is the single most useful thing you can do. Go to System Preferences, select Apple ID, and sign in. Your Apple ID becomes your fastest escape route if you forget your password again. You can also turn on FileVault encryption (System Preferences > Security & Privacy > FileVault) to protect your files, though this adds a recovery key you should write down and store somewhere safe.
Frequently Asked Questions
Will resetting my password delete my files?
No — resetting your password through Apple ID or Recovery Mode leaves all your files intact. Only erasing your Mac deletes files, and that's a separate step you choose deliberately. If you erase, you can restore from a Time Machine backup afterward.
What if I don't remember my Apple ID password either?
Go to iforgot.apple.com on another device and follow Apple's account recovery process. You'll need access to the email address or phone number linked to your Apple ID. Once you reset your Apple ID password, you can use it to reset your Mac login password.
Can I use Recovery Mode if my Mac is encrypted with FileVault?
Yes, but you'll be asked for your login password when Recovery Mode starts. If you don't know it, you'll need your Apple ID to proceed. FileVault doesn't block Recovery Mode — it just adds a password prompt at the beginning.
How long does it take to erase and reinstall macOS?
Erasing usually takes 5 to 15 minutes depending on your drive size. Reinstalling macOS takes 20 to 60 minutes depending on your internet speed and which macOS version you're installing. Plan for at least an hour total if you're also restoring from a backup.
What if I get stuck in Recovery Mode?
Restart your Mac by holding the power button for 10 seconds, then release. If you're still stuck, try restarting again and holding Command + Option + P + R instead — this resets the Mac's firmware and sometimes clears Recovery Mode issues. If that doesn't work, contact Apple Support or visit an Apple Store.