You cannot retrieve a passcode you've forgotten, but you can reset your iPhone and create a new one
Apple does not store your iPhone passcode anywhere, which is why the company cannot retrieve it for you — and why no legitimate service can either. If you've forgotten your passcode, your only option is to erase the iPhone and set it up again. The process takes 30 minutes to an hour and requires either your Apple ID credentials or a recovery key you saved earlier.
If you're locked out of your iPhone right now, the fastest path depends on whether you remember your Apple ID password. If you do, you can reset the phone yourself using iCloud or a computer. If you don't, you'll need to recover your Apple ID first, which can take a few hours to a day.
Key Takeaways
- Your passcode is encrypted on your device only — Apple cannot and will not retrieve it, even with proof of purchase.
- Resetting your iPhone erases all data on it unless you have a backup stored in iCloud or on a computer.
- You can reset a locked iPhone using iCloud.com from any browser if you remember your Apple ID password.
- If you've saved a recovery key for your Apple ID, keep it somewhere safe — it's the fastest way back in if you forget both your passcode and your Apple ID password.
- Scams that promise to unlock iPhones without erasing them are fake; legitimate unlock requires either your credentials or Apple support with proof of ownership.
Reset your iPhone using iCloud if you remember your Apple ID password
Go to iCloud.com from any computer or phone and sign in with your Apple ID and password. Click "Find My" in the app launcher (the grid icon), then select "Find My iPhone" from the menu on the left.
Choose your locked iPhone from the "Devices" list. Click "Erase This Device" and confirm. Your iPhone will erase and restart, and you'll be able to set it up again with a new passcode. This works whether your iPhone is in your hands or across the country.
After the erase completes, your iPhone will ask you to sign in with your Apple ID again. Use the same Apple ID you just used on iCloud.com. Once you're signed in, you can create a new passcode during setup.
Reset your iPhone using a computer if you have a Mac or Windows PC
Connect your locked iPhone to a computer with a USB cable. On a Mac running Monterey or later, open Finder and select your iPhone from the sidebar. On Windows or older Mac, open iTunes instead.
Click "Restore" when prompted. Your computer will download the latest iOS version and erase your iPhone. When the erase finishes, you'll see the setup screen on your iPhone. Sign in with your Apple ID, and you can create a new passcode.
This method works even if you haven't used this computer with your iPhone before, as long as you remember your Apple ID password. If you don't remember your Apple ID password, you'll need to recover it before you can complete setup.
Recover your Apple ID password if you've forgotten that too
Go to iforgot.apple.com and enter your Apple ID (usually your email address). Apple will ask you to verify your identity using either a trusted phone number, a recovery email, or security questions you set up earlier.
If you have a recovery key — a 28-character code Apple gave you when you turned on two-factor authentication — you can use that instead. Enter the key and Apple will let you reset your password immediately without waiting for a text or email.
If you don't have a recovery key and can't access your trusted phone number or recovery email, Apple's account recovery process can take 24 hours or more. You'll need to answer security questions and may need to wait while Apple verifies your identity. Once your Apple ID password is reset, you can use the iCloud method above to erase your iPhone.
What happens to your data when you reset your iPhone
Erasing your iPhone deletes everything on it — photos, messages, apps, settings, all of it. However, if you've been backing up to iCloud, you can restore your data after setup is complete. During the setup process, you'll see an option to "Restore from iCloud Backup." Choose your most recent backup and your photos, messages, and app data will return to your phone.
If you don't have an iCloud backup, your data is gone. This is why regular backups matter: they're your safety net if you forget your passcode, lose your phone, or need to replace it. You can turn on iCloud backup in Settings > [Your Name] > iCloud > iCloud Backup, and Apple will back up your phone automatically when it's plugged in and connected to WiFi.
Scams that claim to unlock iPhones without erasing them
You may see ads or websites promising to unlock your iPhone without erasing it or without your Apple ID. These are scams. There is no legitimate way to bypass an iPhone passcode without erasing the device — Apple designed it that way on purpose to protect your privacy if your phone is stolen.
Services that claim to remove passcodes remotely, unlock iPhones without Apple ID, or bypass security are either fake (they take your money and do nothing) or they're selling stolen phones. If you use one, you risk losing money and potentially buying a device that will be remotely locked by its real owner.
The only legitimate unlock paths are the ones above: using your own Apple ID credentials, using a recovery key you saved, or contacting Apple Support with proof of purchase if you're the registered owner and cannot access your own credentials.
When to contact Apple Support
Contact Apple Support if you've forgotten both your passcode and your Apple ID password, and you don't have a recovery key. You'll need to prove you own the iPhone — usually with a receipt, proof of purchase, or the original box. Apple can verify your identity and help you regain access, but this process takes longer than using your own credentials.
You can reach Apple Support through apple.com/support, by calling 1-800-MY-APPLE, or by visiting an Apple Store in person. Have your proof of purchase ready. If you bought the iPhone from a carrier like Verizon or AT&T rather than Apple, you can also contact them, though they'll likely direct you to Apple.
Frequently Asked Questions
Can Apple tell me what my passcode is?
No. Apple does not store passcodes on its servers — they're encrypted only on your device. Even Apple employees cannot see your passcode. This is intentional: it means no one, not even Apple, can unlock your phone without your permission.
What's the difference between a passcode and Face ID or Touch ID?
Your passcode is a number or alphanumeric code you type. Face ID and Touch ID are biometric shortcuts that unlock your phone without typing. If you forget your passcode, Face ID and Touch ID won't help you unlock it — you'll still need to reset the phone. However, if you remember your passcode, you can change Face ID or Touch ID settings without resetting anything.
If I reset my iPhone, will my photos come back?
Only if you restore from an iCloud backup. If you've been backing up automatically, your photos will return during setup when you choose "Restore from iCloud Backup." If you've never turned on iCloud backup, your photos are permanently deleted when you erase the phone.
How do I make sure I don't forget my passcode again?
Write it down and store it somewhere secure — a locked drawer, a password manager, or a safe. You can also save a recovery key for your Apple ID in a separate location. That way, even if you forget both your passcode and your Apple ID password, you have a way back in without contacting Apple Support.
Can someone else reset my iPhone if they know my Apple ID password?
Yes, which is why your Apple ID password should be as strong as your passcode. If someone has your Apple ID password, they can erase your iPhone remotely using iCloud. Use a unique, strong password for your Apple ID — not the same one you use anywhere else — and turn on two-factor authentication to add an extra layer of protection.