The fastest way depends on what you remember and what device you have access to
If you have forgotten your iPhone passcode, you cannot straightforward reset it the way you would reset a password on a website. Your options depend on whether you have access to another Apple device, a computer, or your recovery key. The method that works fastest for you also depends on whether you set up two-factor authentication and whether you remember your Apple ID password.
The most common path is using iCloud.com from any web browser on a computer or another device. If that is not available to you, you can use a Mac or another iPhone with Find My iPhone turned on. If you have none of those options, you will need to use a computer with iTunes or Finder and a USB cable.
Key Takeaways
- Using iCloud.com from any computer is the fastest method if you remember your Apple ID password and have internet access.
- You will need to erase your iPhone completely to regain access — your data will be gone unless you have a backup.
- If you have two-factor authentication turned on, Apple will send a verification code to a trusted device or phone number you set up earlier.
- Using Find My iPhone on another Apple device is faster than connecting to a computer with a cable, but requires that feature to have been turned on before you were locked out.
- Recovery mode through a computer takes the longest but works even if you have never set up iCloud or Find My iPhone.
Resetting through iCloud.com on any computer
Go to iCloud.com in a web browser on any computer or tablet. Sign in with your Apple ID and password. If you have two-factor authentication turned on, you will receive a code on a trusted device — enter that code to continue.
Click Find My iPhone (or Find My on newer versions). Select your iPhone from the device list. Click Erase iPhone. Confirm the action. Apple will erase your phone remotely and remove the passcode. You can then set it up again from scratch or restore from a backup if you have one saved to iCloud.
This method works from anywhere and takes about five to ten minutes. The trade-off is that your iPhone will be completely erased — all photos, messages, and apps stored only on the device will be gone. If you backed up to iCloud before you were locked out, you can restore that backup after the erase is complete.
Using Find My iPhone on another Apple device
If you have a Mac, iPad, or another iPhone, you can use Find My to erase your locked device. Open Find My on the other device. Sign in with the same Apple ID you use on your locked iPhone. Select your locked iPhone from the device list.
Tap or click Erase This Device. Confirm your choice. Your iPhone will erase and the passcode will be removed. You can then set it up again and restore from backup if you have one.
This method is faster than using a computer with a cable because there is no waiting for a read or connection. It also works if your iPhone is not physically near you. The downside is that Find My must have been turned on before you were locked out — if it was never set up, this option will not work.
Using a computer with a USB cable and Finder or iTunes
Connect your iPhone to a Mac or Windows computer with a USB cable. On a Mac running macOS Monterey or newer, open Finder and select your iPhone from the sidebar. On an older Mac or Windows computer, open iTunes.
Click Restore. Your computer will read the current iPhone software and install it on your phone. This erases the device and removes the passcode. The process takes 15 to 30 minutes depending on your internet speed and which iPhone model you have.
After the restore finishes, you will see the setup screen. You can set a new passcode and restore from a backup if you have one saved to your computer or iCloud. This method works even if you have never set up iCloud or Find My, but it requires a computer and a compatible USB cable.
What happens if you do not have a backup
If you erase your iPhone and do not have a backup, your data is gone. Photos, messages, contacts, and apps stored only on the device cannot be recovered. This is why backing up regularly matters — it gives you a way to restore your information after you regain access.
If you have an iCloud backup, you can restore it during setup after your iPhone is erased. If you have a backup on a computer, you can restore it after connecting to that computer with Finder or iTunes. If you have neither, you will start with a blank iPhone and rebuild from there.
Preventing this from happening again
Turn on two-factor authentication in Settings > [Your Name] > Password & Security. This adds a layer of protection and also makes it easier to reset your passcode later — Apple can verify your identity through a trusted device or phone number.
Back up your iPhone regularly to iCloud or to a computer. Go to Settings > [Your Name] > iCloud > iCloud Backup and turn it on, or connect to a computer and back up through Finder or iTunes. A recent backup means you can restore your data quickly if you ever need to erase your device.
Write down your Apple ID password and store it somewhere safe. You cannot reset your iPhone passcode without it. If you forget your Apple ID password as well, you will need to go through Apple's account recovery process, which takes longer.
What to do if you forgot your Apple ID password too
If you do not remember your Apple ID password and cannot use iCloud.com, you will need to use a computer with a USB cable and Finder or iTunes. The restore process does not require your Apple ID password — only the passcode erase does.
After your iPhone is erased and set up again, you can recover your Apple ID password by going to iforgot.apple.com on any computer. You will need access to the email address or phone number associated with your account. Apple will send you a link or code to reset your password.
Frequently Asked Questions
Can I reset my passcode without erasing my iPhone?
No. Apple does not offer a way to reset your passcode without erasing the device. This is a security feature — it prevents someone else from accessing your phone if they have physical access to it. Erasing is the only way to regain access.
How long does it take to erase and set up my iPhone again?
Erasing through iCloud takes five to ten minutes. Using Find My on another device takes about the same time. Using a computer with a cable takes 15 to 30 minutes for the restore, plus another 10 to 15 minutes for the initial setup. Restoring from a backup adds another 5 to 20 minutes depending on how much data you have.
Will my photos and messages come back after I restore from backup?
Yes, if you have a backup. Restoring from an iCloud backup brings back photos, messages, contacts, apps, and settings that were saved before you were locked out. Anything that happened after your last backup will not be restored. This is why backing up regularly matters.
What if I do not have access to another Apple device or computer?
You will need to borrow a computer from someone else or visit an Apple Store. You cannot reset your iPhone passcode using only the locked iPhone itself. An Apple Store employee can help you erase and set up your device, though you will still need your Apple ID password to complete the setup.
Can someone else reset my iPhone passcode if they have my Apple ID password?
Yes, which is why protecting your Apple ID password matters as much as your passcode. If someone knows both, they can erase your iPhone remotely using iCloud.com. Use a strong, unique password for your Apple ID and turn on two-factor authentication to make it harder for someone to access your account without your knowledge.