The fastest way depends on what you set up before you locked yourself out
You can reset a Mac without the password if you have a recovery key, another admin account, or access to the email address tied to your Apple ID. If you have none of those, you will need to erase the Mac and start over — which takes about an hour but wipes everything on the drive. The method that works for you depends entirely on what you prepared ahead of time, so start with the option that matches your situation.
Do not try to guess the password repeatedly. After five wrong attempts, macOS locks you out for 60 seconds. After more attempts, the lockout gets longer. You will waste time and may trigger security features that make recovery harder.
Key Takeaways
- If you wrote down a recovery key when you first set up your Mac, you can use it to reset the password without erasing anything.
- If you have a second admin account on the same Mac, you can log in with that account and reset the forgotten password from System Settings.
- If you know the email address and password for the Apple ID linked to your Mac, you can use Apple's online account recovery to regain access.
- If none of those options are available, you will need to erase the Mac using Recovery Mode and set it up as new, which deletes all files.
- The entire process — from locked out to usable — takes between 15 minutes and two hours depending on which method you use.
Using a recovery key to reset without erasing
When you first turned on your Mac or enabled FileVault encryption, macOS gave you a recovery key — a long string of letters and numbers. If you saved this key in a safe place, you can use it to reset your password without losing any files or programs.
Restart your Mac and hold down Command + R until you see the Apple logo. This opens Recovery Mode. Click "Utilities" in the menu bar, then "Terminal". Type resetpassword and press Enter. A window will open asking for your recovery key. Paste or type the key exactly as you have it written down. Once the system accepts it, you can create a new password. Restart the Mac and log in with the new password.
This method works only if you have the actual recovery key. If you never wrote it down or cannot find it, move to the next option.
Resetting the password from a second admin account
If someone else set up an admin account on your Mac, or if you created a second admin account yourself, you can use that account to reset the forgotten password.
Log in with the second admin account. Open System Settings and go to "General" (on newer Macs) or "Users & Groups" (on older ones). Find the account with the forgotten password and click the lock icon to unlock it — you will need to enter the password for the admin account you are currently logged into. Click "Reset Password". Enter a new password and a password hint. Click "Reset Password" again. Log out and log back in with the account that was locked, using the new password.
This only works if you can actually access a different admin account. If you are the only admin on the Mac, this route is closed.
Using your Apple ID to recover access online
If your Mac is linked to an Apple ID and you remember the email address and password for that account, you can reset your Mac password through Apple's account recovery system without needing anything else.
At the login screen, click "Forgot password?" or wait for the system to offer password reset options. Follow the prompts to verify your Apple ID. You will be asked to answer security questions or receive a verification code by email or text. Once you verify your identity, you can set a new Mac password. The system will then let you log in.
This method requires that your Mac is connected to the internet and that you have access to the email address or phone number associated with your Apple ID. If your Apple ID itself is locked, you will need to recover that account first through iforgot.apple.com.
Erasing the Mac and starting fresh in Recovery Mode
If you have no recovery key, no second admin account, and no access to your Apple ID, your only option is to erase the Mac and set it up as a new computer. This deletes everything on the drive — all files, programs, photos, and documents. Do this only if you have backups of everything you need.
Restart the Mac and hold Command + R until Recovery Mode opens. Click "Utilities" in the menu bar, then "Disk Utility". Select your main drive (usually called "Macintosh HD" or similar) and click "Erase". Choose a format — APFS is standard for newer Macs, Mac OS Extended for older ones — and give it a name. Click "Erase" and wait for the process to finish. This usually takes 5 to 15 minutes.
Close Disk Utility and you will return to Recovery Mode. Click "Reinstall macOS" and follow the prompts. The system will read and install a fresh copy of macOS. This takes 30 minutes to an hour depending on your internet speed. When it finishes, you will see the setup screen. Create a new account with a password you will remember, and your Mac will be ready to use.
What to do if you are locked out of Recovery Mode too
If your Mac requires a password to enter Recovery Mode, you cannot use the methods above. This happens when FileVault encryption is turned on and the firmware password is set. You will need to contact Apple Support or visit an Apple Store with proof of ownership — usually a receipt or the original box. They can help you regain access, though the process may take several days.
Do not attempt to force your way in or use third-party password-breaking tools. These can damage the Mac's security and may void the warranty. The official route through Apple is slower but safer.
How to avoid this in the future
Write down your recovery key the moment macOS shows it to you. Store it in a physical location you control — a safe, a locked drawer, or a safe deposit box. Do not store it in a note on the Mac itself or in a cloud service you might forget the password to.
Create a second admin account on your Mac, even if you never use it. Give it a strong password and write that down too. This account becomes your backup if you ever lock yourself out of the main one.
Make sure you remember the password to your Apple ID. If you are not sure, go to iforgot.apple.com and verify you can recover it. Test the recovery process before you need it.
Keep regular backups using Time Machine or another backup tool. If you do need to erase your Mac, you can restore your files afterward instead of losing everything.
Frequently Asked Questions
Can I reset my password if my Mac is not connected to the internet?
It depends on the method. The recovery key method works offline. The Apple ID method requires internet. If you are offline and have no recovery key, you will need to connect to the internet or visit an Apple Store.
Will resetting my password delete my files?
No — using a recovery key or a second admin account leaves all your files intact. Only the full erase-and-reinstall method deletes everything. If you use that method, you will lose all files unless you have a backup.
How long does it take to erase and reinstall macOS?
The erase itself takes 5 to 15 minutes. The reinstall takes 30 minutes to an hour, depending on your internet speed. The entire process from locked out to usable is usually 45 minutes to two hours.
What if I do not remember my Apple ID password either?
Go to iforgot.apple.com on another device and follow the recovery steps there. You will need access to the email address or phone number linked to your Apple ID. Once you recover that password, you can use it to reset your Mac password.
Can I use someone else's admin account to reset my password?
Yes, if they are willing to log in and help you. They will need to enter their own password to unlock your account settings and reset yours. After that, your account is yours to control again.