Use your Apple ID to reset your iPhone passcode
If you have forgotten your iPhone passcode, you can reset it using your Apple ID and a computer or another device. This is the most direct path when you still remember your Apple ID password. You will need access to a Mac, PC, iPad, or another iPhone to start the process.
Go to iCloud.com on any web browser and sign in with your Apple ID. Click "Find My" in the app launcher (the grid icon). Select "Find My iPhone" from the menu. Locate your locked iPhone in the device list, click it, and choose "Erase iPhone." This wipes your phone and removes the passcode. When your iPhone restarts, you can set it up again and create a new passcode.
If you do not have access to another device right now, you can also use a Mac or PC with iTunes or Finder. Connect your locked iPhone with a USB cable, open Finder (Mac) or iTunes (Windows), and select your device. Click "Restore" to erase the phone and remove the passcode. Your iPhone will restart and ask you to set it up from the beginning.
Key Takeaways
- You can reset your passcode through iCloud.com from any web browser if you remember your Apple ID password.
- Erasing your iPhone removes the passcode but also deletes all data unless you restore from a backup afterward.
- If you do not remember your Apple ID password, you will need to reset that first before you can erase your iPhone.
- Recovery Mode on your iPhone lets you erase and reset without needing another device, though the process takes longer.
Reset your Apple ID password if you forgot that too
If you cannot remember your Apple ID password, you cannot use iCloud or Finder to erase your iPhone. You will need to reset your Apple ID password first. Go to iforgot.apple.com on any device with internet access and enter your Apple ID email address.
Apple will ask you to verify your identity. You can choose to receive a verification code by email or answer security questions you set up when you created your account. Once you verify, you can create a new Apple ID password. After that, you can sign into iCloud.com and erase your iPhone as described above.
This process usually takes a few minutes. If you set up two-factor authentication on your Apple ID, you may need to verify on a trusted device as well. Keep your new Apple ID password somewhere you can find it — you will need it to set up your iPhone after you erase it.
Use Recovery Mode if you cannot access another device
Recovery Mode lets you erase your iPhone directly on the phone itself, without needing a computer or another device. You will need a USB-C or Lightning cable and a power source. This method works even if you do not remember your Apple ID password, though you will need it when you set up your iPhone again.
The steps differ depending on your iPhone model. On iPhone X and newer, press and hold the Volume Up button and the Side button together until the power-off slider appears. Do not slide it — keep holding both buttons until you see "Recovery Mode" on the screen. On iPhone 8 and earlier, hold the Top (or Side) button until the power-off slider appears, then release and hold the Home button until Recovery Mode appears.
Once Recovery Mode is active, your iPhone will show a recovery screen. Tap "Erase" or "Restore" (the exact wording depends on your iOS version). Confirm that you want to erase your iPhone. The process takes 10 to 20 minutes. When it finishes, your iPhone will restart and ask you to set it up. You can create a new passcode at that point.
What happens to your data when you reset your passcode
Erasing your iPhone to reset the passcode deletes everything on the phone — photos, messages, apps, contacts, and settings. This is permanent unless you restore from a backup. If you have an iCloud backup from before you forgot your passcode, you can restore your data after you set up your iPhone again.
When your iPhone restarts after erasing, it will ask whether you want to restore from a backup or set up as new. If you choose to restore from iCloud, you will need to sign in with your Apple ID. Your photos, messages, and most apps will come back. Some apps may need to be reinstalled from the App Store.
If you do not have a backup, your data is gone. This is why regular backups matter — they protect you if you forget your passcode or your phone is damaged. You can set up automatic iCloud backups in Settings > [Your Name] > iCloud > iCloud Backup, and toggle it on.
Prevent being locked out in the future
Write down your passcode and store it somewhere safe, separate from your phone. A notebook in a drawer at home works better than a note on your phone itself. You could also store it in a password manager like iCloud Keychain, which remembers your passcode for you.
Set up two-factor authentication on your Apple ID. This adds a security layer and makes it easier to reset your password if you forget it — you can verify through a trusted device instead of having to answer security questions. Go to Settings > [Your Name] > Password & Security and turn on two-factor authentication if it is not already on.
Enable iCloud Backup so that if you ever do need to erase your iPhone, you can restore your data afterward. Check your backup regularly to make sure it is working. Go to Settings > [Your Name] > iCloud > iCloud Backup and verify the toggle is on and the last backup date is recent.
What to do if you are locked out of your Apple ID as well
If you cannot remember your Apple ID password and you also cannot access the email address or phone number tied to your account, the reset process takes longer. Go to iforgot.apple.com and enter your Apple ID. If you cannot verify your identity through email or security questions, Apple will ask you to wait a few days before trying again.
During this waiting period, Apple checks your account for suspicious activity. After the wait, you can try to verify again. If you still cannot access your email or phone number, you may need to contact Apple Support directly. They can help you regain access to your account, though it may take several days.
In the meantime, you cannot erase your iPhone remotely. Your only option is Recovery Mode on the phone itself. After you erase it, you will be able to set up your iPhone, but you will not be able to restore your data from iCloud until you regain access to your Apple ID.
Frequently Asked Questions
Will erasing my iPhone remove the passcode?
Yes. Erasing your iPhone completely removes the passcode and all other data. After the erase is complete, your iPhone will restart and ask you to set it up again, including creating a new passcode. You can restore your photos and messages from a backup if you have one.
Can I reset my passcode without erasing my iPhone?
No. There is no way to reset a forgotten passcode without erasing the iPhone. This is a security feature — it prevents someone else from resetting your passcode if they have physical access to your phone. Erasing is the only path forward.
What if I do not have a backup of my data?
If you do not have a backup, your data will be lost when you erase your iPhone. You can set up your phone as new and start over, but photos, messages, and other files will not return. Going forward, turn on iCloud Backup to protect yourself if this happens again.
Do I need a computer to reset my passcode?
No. You can use Recovery Mode directly on your iPhone without a computer. You will need a USB-C or Lightning cable and a power source. If you have access to another device and remember your Apple ID password, using iCloud.com is faster, but Recovery Mode works on its own.
How long does it take to reset my passcode?
Using iCloud.com takes a few minutes if you remember your Apple ID password. Recovery Mode on your iPhone takes 10 to 20 minutes to erase and restart. If you need to reset your Apple ID password first, add another 5 to 10 minutes for that step.