You can reset your iPhone passcode through iCloud, your Apple ID, or a computer — but the method depends on what you remember and what you set up beforehand
If you have forgotten your iPhone passcode, you have three main routes: use iCloud's Find My iPhone feature, reset through your Apple ID on the device itself, or connect to a computer with iTunes or Finder. Each one works only if you set up certain things in advance — which is why the fastest path depends on what you did when you first bought the phone. The process erases your device, so you will lose any data you have not backed up to iCloud or a computer.
If you are locked out right now and do not remember your Apple ID password either, you will need to verify your identity through Apple's account recovery process, which can take a few days. Plan for that time before you start.
Key Takeaways
- Resetting your passcode always erases your iPhone, so you will lose any photos, messages, or apps that are not backed up to iCloud or a computer.
- If you remember your Apple ID and password, you can reset the passcode directly on the device through Settings without needing a computer.
- If you do not remember your Apple ID password, use iCloud.com from another device to reset it first, then use that to unlock your iPhone.
- If you set up a trusted phone number or email address with your Apple ID, Apple can send you a reset code within minutes instead of days.
- Connecting your iPhone to a Mac or Windows computer with Finder or iTunes is the slowest method but works if you have no other way to verify your identity.
Reset your passcode through Settings if you remember your Apple ID
If your iPhone is powered on and you can reach the lock screen, you can reset the passcode without a computer. Tap the lock screen, then tap "iPhone Unavailable" at the bottom. You will see an option that says "Try after [time]" — keep tapping until you see "iPhone Unavailable — Use Recovery Mode" or a similar message. At that point, tap "Emergency SOS" or swipe up, then when ready hang up. Go back to the lock screen and tap "Emergency SOS" again, then hang up again. This forces the device to show you the passcode reset option.
Once you see the reset option, tap it and enter your Apple ID email and password. The device will ask you to set a new passcode. You will then need to set up your iPhone again — it will ask for your Apple ID password, your Wi-Fi network, and whether you want to restore from a backup. If you have a recent iCloud backup, choose "Restore from iCloud Backup" to get your photos, messages, and other data back. If you do not have a backup, you will start with a blank phone.
Use iCloud.com to reset your passcode from another device
If your iPhone is powered off or you cannot reach the lock screen, go to iCloud.com from a computer, tablet, or another phone. Sign in with your Apple ID and password. Click "Find My" (or "Find My iPhone" on older accounts), then select your iPhone from the list of devices.
Click "Erase iPhone" and confirm. This erases the device remotely and removes the passcode. Your iPhone will power on and show the setup screen. When it does, sign in with your Apple ID and choose whether to restore from a backup. This method works even if your phone is off — Apple will erase it the next time it connects to the internet.
If you do not remember your Apple ID password, you will need to reset it before you can erase the device. Go to iforgot.apple.com, enter your Apple ID email, and follow the prompts. If you set up a trusted phone number or email address, Apple will send you a code within minutes. If you did not set up a trusted contact, Apple will ask you to answer security questions or wait for account recovery, which can take several days.
Reset through a computer using Finder or iTunes
Connect your iPhone to a Mac with Finder or a Windows computer with iTunes. On a Mac running Catalina or newer, open Finder and click your iPhone in the sidebar. On a Windows computer or older Mac, open iTunes and click the device icon. You should see a summary screen with your device information.
Click "Restore" (or "Restore iPhone" in iTunes). The computer will read the latest iPhone software and install it on your device, erasing everything in the process. When the setup screen appears, sign in with your Apple ID and choose to restore from a backup if you have one. This method is slower than iCloud because the software read can take 20 to 40 minutes depending on your internet speed, but it works if you have no other way to verify your identity.
What happens to your data after you reset the passcode
Resetting your passcode erases your iPhone completely. Any photos, messages, notes, or apps stored only on the device will be gone. The only way to get them back is to restore from a backup you made before you forgot the passcode.
If you use iCloud backup, your data may already be backed up automatically. To check, go to Settings > [Your Name] > iCloud on any device where you are signed in, and look for "iCloud Backup." If it is turned on, your most recent backup was created on the date shown. When you set up your iPhone after the reset, you can choose "Restore from iCloud Backup" and get your photos, messages, and other data back. Apps will read again from the App Store automatically.
If you do not have a backup, you will lose everything. This is why setting up iCloud backup when you first get an iPhone matters — it takes five minutes and runs automatically every night when your phone is plugged in and on Wi-Fi.
Prevent future lockouts by setting up recovery options now
Once you have reset your passcode and set up your iPhone again, take 10 minutes to set up the things that make future resets faster. Go to Settings > [Your Name] > Password & Security and make sure you have a trusted phone number and a recovery email address listed. Apple uses these to send you a reset code in minutes instead of days if you ever forget your Apple ID password.
Also turn on iCloud Backup. Go to Settings > [Your Name] > iCloud > iCloud Backup and toggle it on. Your phone will back up automatically every night when it is plugged in and connected to Wi-Fi. This means if you ever need to reset your passcode again, you can restore all your data instead of starting from scratch.
Write down your Apple ID email and password and store it somewhere safe — a password manager, a locked drawer, or a trusted person. If you lose both your passcode and your Apple ID password, recovery takes much longer.
What to do if you cannot remember your Apple ID password either
If you are locked out of your iPhone and you do not remember your Apple ID password, start by resetting your Apple ID password at iforgot.apple.com. Enter your Apple ID email address and choose how you want to verify your identity. If you set up a trusted phone number, Apple will text you a code within minutes. If you set up a recovery email address, Apple will send you a link to that email.
If you did not set up either of those, Apple will ask you to answer the security questions you chose when you created your account. If you cannot answer those either, you will need to go through account recovery. This process confirms your identity through your payment method, your device history, or other information Apple has on file. It can take three to five business days. Once your account is recovered, you can reset your iPhone passcode using any of the methods above.
Frequently Asked Questions
Will I lose my photos and messages when I reset my passcode?
Yes, unless you have a backup. Resetting your passcode erases your entire iPhone. If you have iCloud Backup turned on, your photos, messages, and other data are backed up automatically and you can restore them after the reset. If you do not have a backup, that data is gone permanently.
How long does it take to reset my passcode through iCloud?
If your iPhone is powered on and connected to the internet, the erase completes in a few minutes and you will see the setup screen right away. If your phone is off, Apple will erase it the next time it connects to the internet, which could be hours or days depending on when you turn it back on.
Can I reset my passcode without erasing my iPhone?
No. Apple does not offer a way to change your passcode without erasing the device. This is a security feature — it prevents someone else from resetting your passcode and accessing your data. The only way to avoid losing data is to have a backup you can restore from.
What if I do not have access to another device to use iCloud.com?
You can borrow a computer, tablet, or phone from someone else and go to iCloud.com to erase your iPhone remotely. You only need access to another device long enough to sign in with your Apple ID and click "Erase iPhone." You do not need to own the device you are using.
How do I know if my iPhone is backed up to iCloud?
On any device where you are signed in with your Apple ID, go to Settings > [Your Name] > iCloud and look for "iCloud Backup." If it is turned on, you will see the date and time of your most recent backup. If the backup is from today or yesterday, your recent data is safe and you can restore it after you reset your passcode.