What you can actually retrieve and what you cannot
Your iPhone password — the code you type to unlock the device — cannot be retrieved once you forget it. Apple does not store it anywhere, not even in their servers. What you can do instead is reset the device to factory settings and set a new password, but this erases everything on the phone unless you have a backup.
If you have a backup stored in iCloud or on a computer, you can restore your photos, messages, contacts, and apps after you reset. The password itself is gone permanently; you will create a new one during setup.
The path forward depends on whether you have access to your Apple ID, whether you remember the password to that account, and whether you have a backup waiting to restore from.
Key Takeaways
- iPhone passwords cannot be recovered — they can only be reset by erasing the device and creating a new password.
- If you have an iCloud backup, your data can be restored after the reset, but the backup itself does not contain the password.
- You will need your Apple ID and its password to reset your iPhone; if you do not have those, recovery takes longer and may require proof of purchase.
- A computer with Finder (Mac) or iTunes (Windows) can reset your iPhone if you have previously synced it and trusted that computer.
- If you set up Face ID or Touch ID on your iPhone, you can use those to unlock it even if you forget the passcode.
Using Face ID or Touch ID to unlock without resetting
If you set up Face ID or Touch ID when you first configured your iPhone, you can unlock the device with your face or fingerprint even if you cannot remember the passcode. This does not retrieve the password, but it lets you stay in the phone and change the password to something you will remember.
Go to Settings, then Face ID & Passcode (or Touch ID & Passcode on older models). Tap "Change Passcode" at the top. You will be asked to authenticate with Face ID or Touch ID, then you can enter a new passcode. Write it down or store it in a password manager before you close this screen.
Resetting your iPhone using your Apple ID
If you cannot use Face ID or Touch ID, you will need to erase the iPhone and set it up again. The fastest way is through iCloud.com from any computer or another phone.
Go to iCloud.com and sign in with your Apple ID and password. Click "Find My" in the app launcher (the grid icon). Select "Find My iPhone" from the menu. Choose your device from the list, then click "Erase iPhone." Confirm the action. Your phone will be wiped and will restart at the setup screen, where you can create a new passcode.
After setup completes, you will be asked whether to restore from a backup. If you have an iCloud backup, select it and your data will read to the phone over the next few hours. If you do not have an iCloud backup, you can set the phone up as new and manually re-read apps from the App Store.
Resetting your iPhone using a computer
If you do not remember your Apple ID password, you can still reset the phone using a Mac or Windows computer you have previously synced with. The computer must have been trusted by your iPhone at some point in the past.
On a Mac with macOS Monterey or newer, open Finder and plug in your iPhone with a USB cable. Click your device name in the sidebar, then click "Restore" in the General tab. On a Windows computer, open iTunes, plug in the iPhone, click the device icon, and select "Restore iPhone" from the Summary tab. Both will read the latest iOS software and erase the phone, then restart it at setup.
You will still need your Apple ID and its password to complete setup and restore from backup. If you do not have that password, move to the next section.
Recovering your Apple ID password first
If you have forgotten both your iPhone passcode and your Apple ID password, you need to reset the Apple ID password before you can fully restore your phone. Go to iforgot.apple.com on any device and enter your Apple ID email address.
Apple will ask you to verify your identity using a trusted phone number, a recovery key (if you saved one), or security questions you answered when you created the account. Once you verify, you can set a new Apple ID password. Write it down. Then return to resetting your iPhone using the method above.
What to do if you do not have a backup
If you have never turned on iCloud backup and have not synced your iPhone to a computer, there is no backup to restore from. After you reset the phone and create a new passcode, you will set it up as a new device. Your photos, messages, and app data will be gone.
You can still recover some information. Your contacts may sync back if you use Gmail, Outlook, or another email service that stores them in the cloud. Your photos may be recoverable if you use Google Photos, OneDrive, or another cloud service. Check those accounts on a computer and read what you need, then add those accounts to your newly reset iPhone during setup.
Going forward, turn on iCloud backup when ready after you set up your new passcode. Go to Settings, tap your name at the top, select iCloud, then tap iCloud Backup and turn it on. Your phone will back up every night when it is plugged in and connected to Wi-Fi.
When you need proof of purchase or identity
If you cannot access your Apple ID, do not have a trusted computer, and do not have a recovery key, Apple will ask for proof that you own the device. This is called set up Lock, and it is designed to prevent theft.
You can provide a receipt from your purchase, a credit card statement showing the charge, or the original box with the serial number. Contact Apple Support through apple.com/support and explain that you have forgotten your passcode and cannot access your Apple ID. They will walk you through verification and may be able to unlock the device remotely or provide a path to reset it.
This process can take several days. If you have the original receipt or box, have it ready before you contact them.
Frequently Asked Questions
Can someone else reset my iPhone if they know my Apple ID password?
Yes. Anyone with your Apple ID and password can erase your iPhone remotely using Find My iPhone. This is why your Apple ID password should be as strong as your bank password. Use a password manager to store it, and enable two-factor authentication on your Apple ID account so that a password alone is not enough to access it.
Will resetting my iPhone delete my photos and messages?
Yes, unless you have a backup. If you have iCloud backup turned on, your photos and messages will be restored after you reset. If you do not have a backup, they will be permanently deleted. Check your iCloud settings now to see if backup is on.
What if I do not remember my Apple ID email address?
Your Apple ID is usually the email address you use to sign in to iCloud, the App Store, or Apple Music. Check your iPhone settings under your name at the top, or look at your Apple device receipts. If you still cannot find it, contact Apple Support with proof of purchase and they can help you locate it.
Can I use someone else's computer to reset my iPhone?
You can use any computer to reset your iPhone through iCloud.com, as long as you know your Apple ID and password. You cannot use Finder or iTunes on a computer that has never synced with your iPhone unless you also know your Apple ID password. A computer that previously synced with your phone will let you reset it without the Apple ID password, but only if it still has that trust relationship saved.
How long does it take to restore from an iCloud backup?
Restoring from iCloud backup can take anywhere from 30 minutes to several hours, depending on how much data you have and how fast your internet connection is. Your phone will show a progress bar during the restore. Keep it plugged in and connected to Wi-Fi until the restore finishes.