What to do if you forgot your iPhone passcode
If you cannot remember your iPhone passcode, you have three main paths: use a computer to reset it through your Apple ID, use Find My iPhone on another device, or take the phone to an Apple Store. Which one works depends on whether you have access to your Apple ID password, whether you set up Find My iPhone before you got locked out, and how much time you have.
The fastest route for most people is a computer running macOS or Windows. You will need the Apple ID and password you used to set up the phone. If you do not have those, or if you cannot remember your Apple ID password either, the process takes longer but still works — you just have to verify your identity through email or a recovery key instead.
Key Takeaways
- A Mac or Windows computer with access to your Apple ID is the fastest way to reset your passcode without losing data.
- Find My iPhone on another Apple device works if you turned it on before you got locked out, and it erases the phone.
- If you do not have a computer or another device, Apple Store staff can reset the phone but will need proof of ownership.
- You can reset your Apple ID password through your email address or a recovery key if you do not remember it.
- After you reset your passcode, you can restore your data from a backup if you made one before you got locked out.
Resetting your passcode on a Mac or Windows computer
Connect your iPhone to a Mac or Windows computer using a USB cable. Open Finder on Mac (or File Explorer on Windows) and look for your iPhone in the sidebar. Click on it, then look for a button that says "Restore" — this will appear if the system detects that your passcode is locked.
When you click Restore, the computer will ask you to sign in with your Apple ID. Enter the email address and password you used to set up the phone. The computer will then erase the phone and install a fresh copy of iOS. You will not lose your data if you have a backup — after the phone restarts, you can restore from an iCloud backup or a backup you made on that same computer.
If you do not remember your Apple ID password, click "Forgot Apple ID or password?" on the sign-in screen. Apple will send a code to the email address connected to your account, or you can use a recovery key if you saved one. Follow the prompts to reset your password, then return to the restore process.
Using Find My iPhone from another device
If you have another iPhone, iPad, or Mac, you can use Find My iPhone to reset the locked phone remotely. Open Find My on the other device, tap or click Devices, then select your locked iPhone from the list. Tap "Erase This Device" and confirm.
This method erases everything on the phone, including your passcode. After the erase completes, the phone will restart and ask you to set it up again. You can then restore your data from an iCloud backup if you have one. This only works if you turned on Find My iPhone before you got locked out — if you did not, this option will not appear in the list.
Resetting at an Apple Store
If you do not have a computer or another Apple device, you can visit an Apple Store and ask for help. Bring a photo ID and proof that you own the phone — a credit card receipt, your phone bill, or the original box all work. Staff will verify your identity and then reset the phone using their own tools.
The process takes 15 to 30 minutes. You will need to sign in with your Apple ID when the phone restarts, so make sure you know your Apple ID password or have access to the email address connected to your account. After the reset, you can restore from a backup if you have one saved to iCloud.
What happens to your data after a reset
Resetting your passcode erases the phone itself, but your data is safe if you have a backup. iCloud automatically backs up your phone every day if you turned on iCloud Backup before you got locked out. To check whether you have a backup, go to iCloud.com on a computer, sign in with your Apple ID, and look for your phone in the Devices section.
If you made a backup on a computer using Finder or iTunes, that backup is also saved and ready to restore. After you reset your passcode and set up the phone again, you will see an option to restore from a backup. Choose the most recent one, and your apps, photos, messages, and settings will come back.
If you do not have a backup, you will lose the data that was on the phone. This is why it is worth checking iCloud.com before you reset — if a backup exists, you know your data will be there when you restore.
Preventing this from happening again
After you set a new passcode, turn on iCloud Backup so your data backs up automatically. Go to Settings, tap your name, then iCloud, then iCloud Backup, and turn it on. Make sure you are signed in with your Apple ID first.
Write your Apple ID password somewhere safe, or use a password manager to store it. If you forget your Apple ID password in the future, you can reset it through your email, but having it written down saves time. You can also set up a recovery key in your Apple ID settings — this is a code that lets you reset your password without needing email access, and it works even if someone else has control of your email account.
If you do not remember your Apple ID password
When you try to restore your iPhone on a computer, the system will ask you to sign in with your Apple ID. If you do not remember the password, click "Forgot Apple ID or password?" and Apple will send a reset code to the email address on your account. Check that email, enter the code, and create a new password.
If you do not have access to that email address, you can use a recovery key instead — this is a code you set up in advance in your Apple ID settings. Enter the recovery key on the sign-in screen, and Apple will let you reset your password without needing email access. If you do not have a recovery key and cannot access your email, you will need to contact Apple Support or visit an Apple Store to verify your identity another way.
Frequently Asked Questions
Will resetting my passcode delete my photos and messages?
Not if you have a backup. The reset erases the phone itself, but your data stays in iCloud or on your computer. When you restore from that backup after the reset, your photos, messages, and apps come back. If you do not have a backup, those items will be gone.
Can I reset my passcode without a computer or another Apple device?
Yes, but you will need to visit an Apple Store. Bring a photo ID and proof of ownership. Staff can reset the phone using their tools, and you can restore your data from an iCloud backup afterward. The process takes 15 to 30 minutes.
What if I do not remember my Apple ID password and cannot access my email?
If you set up a recovery key in your Apple ID settings before you got locked out, you can use that code to reset your password. If you do not have a recovery key, contact Apple Support or visit an Apple Store — they can verify your identity through other methods, like a credit card or phone number on file.
How long does it take to reset my passcode?
On a computer, the process takes 10 to 20 minutes from start to finish. Using Find My iPhone takes about 5 minutes. At an Apple Store, plan for 15 to 30 minutes. Restoring your data from a backup afterward can take anywhere from a few minutes to an hour, depending on how much data you have.
Can I reset my passcode if Find My iPhone is turned off?
Yes. You can still use a computer or visit an Apple Store. Find My iPhone only matters if you want to reset the phone remotely from another device — if that feature is off, you will need one of the other two methods.