The fastest way depends on whether you remember any password at all

If you can log in with your Apple ID, use the Mac's built-in password reset tool on the login screen. If you cannot log in at all, you will need either your Apple ID credentials, a recovery key, or access to another admin account on that Mac. If none of those exist, you will need to erase the Mac and set it up again — there is no backdoor into a Mac you do not own credentials for.

The method that works fastest is the one that matches what you actually have access to right now. Start with what you remember or have written down, then move to the next option if that does not work.

Key Takeaways

  • If you can reach the login screen, click the question mark icon to reset your password using your Apple ID without erasing anything.
  • If you have your Apple ID password but cannot log in to the Mac, restart in Recovery Mode (Command-R during startup) and use the password reset tool there.
  • A recovery key, generated when you set up two-factor authentication on your Apple ID, can unlock your Mac if you have it written down somewhere.
  • If you have no Apple ID access and no other admin account, you will need to erase the Mac using another computer and macOS Recovery, then set it up fresh.
  • Write down your Apple ID password and recovery key in a physical location only you can access — this prevents being locked out later.

Reset your password from the login screen

This is the fastest method if you can see the login screen. Look for a small question mark icon (?) next to the password field. Click it. The Mac will ask for your Apple ID email address and password.

Enter your Apple ID credentials. The Mac will send a verification code to a trusted device — usually your iPhone or another Mac you own. Check that device, enter the code, and then create a new Mac password. You do not need to erase anything, and you can log in when ready with the new password.

This method only works if you have access to a device that receives Apple ID verification codes. If you do not have that device anymore, move to the Recovery Mode method below.

Use Recovery Mode if you cannot log in at all

Restart your Mac and hold Command-R as it starts up. Keep holding until you see the Apple logo or a spinning globe. This boots the Mac into Recovery Mode, a separate system that exists outside your normal login.

Once in Recovery Mode, open Utilities from the menu bar and select Terminal. Type resetpassword and press Enter. This opens the password reset tool. Select your user account, enter your Apple ID email and password, and create a new Mac password. Restart the Mac normally and log in with the new password.

If the password reset tool does not appear or you do not have your Apple ID password, you will need your recovery key instead. A recovery key is a 28-character code generated when you turned on two-factor authentication for your Apple ID. If you have this code written down, you can use it in place of your Apple ID password in the reset tool.

What to do if you have no Apple ID access

If you do not have your Apple ID password, do not have a recovery key, and do not have access to a device that receives verification codes, you cannot reset the password on this Mac without erasing it. This is intentional — Apple locks out anyone who cannot prove they own the account.

To erase and set up the Mac fresh, you will need another computer with internet access. On that computer, go to support.apple.com/en-us/HT204904 and follow the instructions to create a bootable USB drive with macOS. Insert that drive into the locked Mac, restart while holding Option, select the USB drive, and follow the setup process to erase the Mac and install a fresh copy of macOS. You will then set up a new user account and password from scratch.

This process takes 30 minutes to an hour depending on your internet speed. You will lose any files on the Mac unless you have a Time Machine backup from before you were locked out.

If another admin account exists on the Mac

If someone else set up an admin account on this Mac and you have access to it, you can reset your password from that account without Recovery Mode. Log in as the other admin, open System Settings, go to General, then Users & Groups. Select your account, click the lock icon to unlock it, and choose "Reset Password." You can then create a new password and log in as yourself.

This only works if the other account is still on the Mac and you know its password. If that account was deleted or you do not know its password, you are back to the Recovery Mode or erase-and-reinstall methods.

Prevent this from happening again

Write your Apple ID password in a physical location only you can access — a notebook in a safe, a locked drawer, or a safe deposit box. Do not store it in a notes app or email, because those can be lost if you lose access to your devices.

When you set up two-factor authentication on your Apple ID (which you should do), Apple generates a recovery key. Write this down on paper and store it in the same find location as your password. A recovery key looks like XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX and is 28 characters long. If you ever lose access to all your trusted devices, this key can unlock your account and your Mac.

If you use a password manager like 1Password or Bitwarden, you can store your Apple ID password there instead of writing it by hand — but make sure you know the master password to that manager and have a way to access it if you lose your Mac.

Frequently Asked Questions

Can I reset my password if I do not have my iPhone?

Yes, but the method depends on what you do have. If you can reach the login screen, you can use the question mark icon and verify your identity through a different trusted device — a Mac, iPad, or even a phone number on file with Apple. If you cannot log in at all, use Recovery Mode and your recovery key instead of your Apple ID password.

What if I forgot my Apple ID password too?

Go to iforgot.apple.com on any device with internet access. Enter your Apple ID email, answer your security questions or use a trusted device to verify your identity, and reset your Apple ID password. Once you have that password, you can use it to reset your Mac password through Recovery Mode or the login screen.

Will resetting my password delete my files?

No. Resetting your password through the login screen or Recovery Mode keeps all your files intact. Only the erase-and-reinstall method deletes everything, and you should only do that if you have no other way to access the Mac. If you have a Time Machine backup, you can restore your files after the erase.

How do I know if I have a recovery key?

A recovery key was generated only if you turned on two-factor authentication for your Apple ID. Check your email for a message from Apple with the subject line "Your Apple ID recovery key" — it will contain a 28-character code. If you cannot find that email, you do not have a recovery key on file.

Can someone else reset my Mac password?

Only if they have your Apple ID password, your recovery key, or access to a trusted device that receives your verification codes. If you share your Mac with someone you do not trust, use a strong, unique password and keep your Apple ID credentials private. Do not write your password on a sticky note on the monitor.