You can regain access through your Apple ID, a trusted device, or by erasing and setting up the phone fresh
When you forget your iPhone passcode, you have three main paths forward. The fastest is using a trusted device or your Apple ID to reset it remotely. If you don't have either, you'll need to erase the phone and set it up again — a longer process, but one that works even if you're locked out completely. Which route you take depends on what you have access to right now and how much data you want to preserve.
The key difference between these methods is whether your data stays on the phone. Remote reset through Apple ID or a trusted device keeps your photos, messages, and apps intact. Erasing the phone wipes everything unless you have a backup stored in iCloud or on a computer.
Key Takeaways
- If you remember your Apple ID email and password, you can reset your passcode from any web browser without erasing the phone.
- A trusted device — any iPhone, iPad, or Mac you've signed into with the same Apple ID — can reset your passcode in minutes.
- If you have neither an Apple ID password nor a trusted device, you must erase the phone, which deletes all data unless you have a backup.
- After six failed passcode attempts, the phone locks for one minute; after ten attempts, it locks for one hour or longer.
- Recovery mode (using a computer) and Find My iPhone are both free options built into iOS and iCloud.
Resetting your passcode with your Apple ID from any computer
Go to iforgot.apple.com on any computer or phone with internet access. Enter the email address you use for your Apple ID, then follow the prompts to verify your identity. Apple will ask you to answer security questions you set up when you created the account, or to enter a verification code sent to your email or phone number.
Once verified, you'll see an option to reset your passcode. Choose this, and Apple will walk you through creating a new one. Your iPhone will ask you to enter this new passcode the next time you unlock it. This method keeps all your data on the phone — nothing is erased.
If you don't remember the security questions and can't receive codes at your registered email or phone, Apple has a recovery process that takes longer but still works. You'll need to provide proof of purchase or other account details. This can take several days.
Using a trusted device to reset your passcode
A trusted device is any iPhone, iPad, or Mac you've previously signed into with your Apple ID. If you have access to one, this is often the fastest route. On that device, open Settings (iPhone or iPad) or System Settings (Mac), tap or click your name at the top, then select "Password & Security" or "Security."
Look for an option to change your passcode or reset your password. The exact wording varies by iOS version, but the setting is always in your Apple ID section. Tap "Change Passcode" and follow the prompts. You'll need to enter the passcode for the trusted device itself, then create a new one for your locked iPhone.
This method also preserves all your data. The new passcode syncs to your locked phone within minutes, and you can unlock it when ready.
Erasing and setting up your iPhone when you have no other options
If you don't have your Apple ID password and no trusted device is available, you'll need to erase the phone. Connect it to a computer with a USB cable. On a Mac, open Finder; on Windows, open iTunes. Your computer should recognize the phone and show a recovery option.
Click "Restore" to erase the phone and reinstall iOS. This takes 15 to 30 minutes depending on your internet speed. When it finishes, the phone will restart and show the setup screen, as if it were brand new.
During setup, you can sign back into your Apple ID. If you do, iCloud will restore your photos, contacts, messages, and app data — but only if you had iCloud backup turned on before you forgot the passcode. If you didn't have backups, this data is gone. Apps themselves will reinstall, but their settings and saved data within those apps may not return.
Using Find My iPhone to reset remotely
If you have another Apple device or access to iCloud.com, you can use Find My iPhone to erase your phone remotely and set it up fresh. Go to iCloud.com, sign in with your Apple ID, and select "Find My." Choose your locked iPhone from the list of devices.
Select "Erase iPhone," and the phone will wipe itself over the internet. You don't need the phone in your hands — it will erase the next time it connects to the internet. After erasing, set it up again and sign back into your Apple ID to restore from backup if you have one.
This method is useful if your phone is lost or stolen, but it's slower than the other options because the erase happens only when your phone connects to WiFi or cellular data. If your phone is offline, it may take hours or days.
What happens if you enter the wrong passcode repeatedly
After six wrong attempts, your iPhone locks for one minute. After the seventh attempt, it locks for five minutes. The eighth attempt locks it for 15 minutes. After the tenth attempt, the phone locks for one hour — or longer if you keep trying.
This is a security feature to slow down anyone trying to guess your passcode. It's frustrating when you're locked out, but it also means a stranger can't rapidly try thousands of combinations. Wait out the lockout period before trying again.
Protecting yourself from a forgotten passcode in the future
Write your passcode down and store it somewhere find — a physical notebook in a drawer, a password manager like 1Password or Bitwarden, or even a note in your partner's phone. This sounds basic, but most people who forget their passcode wish they'd done this.
Turn on iCloud backup so that if you ever do need to erase your phone, your data comes back when you sign in again. Go to Settings, tap your name, select "iCloud," then "iCloud Backup," and toggle it on. Backups happen automatically when your phone is plugged in, locked, and on WiFi.
Keep your Apple ID password separate from your iPhone passcode. Your Apple ID password is what unlocks your account online; your iPhone passcode is what unlocks the phone itself. Forgetting one doesn't mean you've forgotten the other, and that separation is what lets you recover.
Frequently Asked Questions
How long does it take to reset my passcode?
Using Apple ID or a trusted device takes 5 to 15 minutes. Erasing and setting up the phone takes 20 to 45 minutes depending on your internet speed and how much data restores from backup. Find My iPhone erase can take hours because it waits for your phone to connect to the internet.
Will I lose my photos and messages if I reset my passcode?
No, if you use Apple ID or a trusted device to reset. If you erase the phone, you'll lose everything unless you have an iCloud backup or a backup on a computer. Check Settings > [Your Name] > iCloud > iCloud Backup to see if backups are turned on.
What if I don't remember my Apple ID email address?
Go to iforgot.apple.com and enter any email address you think might be linked to your account. If it's not your Apple ID, the site will tell you. You can also check any device you've signed into — go to Settings, tap your name, and it shows your Apple ID email at the top.
Can Apple unlock my iPhone for me over the phone?
No. Apple Support can walk you through the reset process, but they cannot unlock your phone directly. They can help you verify your identity if you're stuck on the iforgot.apple.com recovery process, which sometimes takes several days.
What if my phone is in a different country and I can't access it?
Use Find My iPhone from iCloud.com to erase it remotely. You don't need the phone in your hands — it will erase when it next connects to WiFi or cellular data, even if it's thousands of miles away. After erasing, you can set it up fresh when you get to it.