Where your iPhone password is stored and why you can't just look it up
Your iPhone password — the one you use to unlock the device — is not stored anywhere you can read it back. Apple encrypts it the moment you create it, which means even Apple's own engineers cannot see what you typed. This is intentional security: if passwords were readable, anyone with access to Apple's servers could unlock every iPhone.
Because of this encryption, you cannot retrieve a forgotten password by calling Apple support or checking your account settings. Instead, you have two real paths forward: reset the password on the device itself if you remember any other way to unlock it, or erase the iPhone and set it up fresh.
Key Takeaways
- If you can unlock your iPhone using Face ID, Touch ID, or a trusted device, you can change your password without erasing anything.
- If you cannot unlock the iPhone at all, you must erase it and set it up as new, which deletes all data unless you have a backup.
- Your Apple ID password is separate from your iPhone unlock password and can be reset through your Apple account online.
- Before you erase an iPhone, check whether Find My iPhone is turned on — if it is, you will need your Apple ID password to reactivate it.
Resetting your password when you can still unlock the iPhone
If you can get into your iPhone using Face ID, Touch ID, or a passcode you remember, you can change your unlock password without losing any data. Open Settings, then tap Face ID & Passcode (on newer iPhones) or Touch ID & Passcode (on older ones). You will see a button that says "Change Passcode" near the top. Tap it, then enter your current passcode when prompted.
Next, enter the new passcode you want to use. Apple will ask you to enter it twice to confirm. You can use a four-digit code, a six-digit code, or a longer alphanumeric password — the choice is yours, and you can change it again later if you want something different. Once you confirm, the new passcode takes effect when ready.
Erasing the iPhone if you cannot unlock it at all
If you cannot unlock the iPhone using any method, your only option is to erase it and start over. You can do this through a computer using Finder (on Mac) or iTunes (on Windows), or you can use iCloud's Find My iPhone feature from any web browser.
To erase using a computer: connect the iPhone with a USB cable, open Finder or iTunes, select the device, and choose "Restore." This erases the iPhone and installs a fresh copy of iOS. You will then set it up as a new device or restore from a backup if you have one saved to iCloud or your computer.
To erase using Find My iPhone online: go to iCloud.com, sign in with your Apple ID, click Find My iPhone, select your device from the list, and choose "Erase iPhone." This works from anywhere and does not require a computer or cable. After erasing, the iPhone will restart and show the setup screen.
What happens if Find My iPhone is turned on
Before you erase an iPhone, check whether Find My iPhone is active. If it is, Apple locks the device after erasing to prevent theft — a security feature called set up Lock. To unlock it again, you must enter the Apple ID and password that were used to set up the iPhone originally.
If you do not remember that Apple ID password, you can reset it at iforgot.apple.com. You will need access to the email address or phone number associated with the account. Apple will send a reset link or code, and you can create a new password from there. Once you have the new password, use it to unlock the iPhone after erasing.
The difference between your iPhone password and your Apple ID password
These are two separate things, and confusion between them is common. Your iPhone passcode is what you type to unlock the physical device — the six digits or longer code you enter on the lock screen. Your Apple ID password is what you use to sign into your Apple account online, in the App Store, and in iCloud settings.
If you forgot your Apple ID password, you do not need to erase your iPhone. Go to iforgot.apple.com from any computer or phone, enter your Apple ID email, and follow the reset steps. You can then use the new password to sign into your account anywhere. Your iPhone unlock code stays the same unless you change it separately in Settings.
Backing up before you erase
If you have access to a computer where you previously backed up this iPhone, connect it and create a fresh backup before erasing. This way, after you erase and set up the device again, you can restore all your photos, messages, contacts, and apps from that backup.
If you have iCloud backup turned on, your data may already be backed up to your Apple ID account. After you erase and set up the iPhone, you can sign in with the same Apple ID and choose to restore from the iCloud backup. Check iCloud.com to see whether a recent backup exists before you erase.
Preventing this from happening again
Once you have regained access to your iPhone, consider using a passcode you can actually remember, or write it down and store it somewhere safe away from the device itself. If you prefer not to memorize it, Face ID or Touch ID removes the need to type a passcode most of the time — you only need it when the biometric fails or when you restart the phone.
You can also turn on iCloud backup in Settings under your name, then iCloud, then iCloud Backup. This ensures your data is saved even if something happens to the device. If you ever need to erase again, you can restore everything from that backup without losing photos, messages, or contacts.
Frequently Asked Questions
Can Apple support help me unlock my iPhone if I forgot the password?
No. Apple does not store your passcode and cannot retrieve it. If you cannot unlock the device, you must erase it. Apple support can walk you through the erasing process and help you restore from a backup afterward, but they cannot bypass the password itself.
What if I do not remember my Apple ID password either?
You can reset it at iforgot.apple.com without the iPhone. You will need access to the email or phone number on the account. Once you reset the Apple ID password, use it to unlock the iPhone after erasing, or to sign into your account on the device.
Will erasing my iPhone delete my photos and messages?
Yes, erasing removes everything from the device. However, if you have iCloud backup or a computer backup, you can restore your photos, messages, and other data after you set up the iPhone again. Check iCloud.com before erasing to see if a backup exists.
Can I erase my iPhone without a computer or cable?
Yes. Go to iCloud.com from any web browser, sign in with your Apple ID, click Find My iPhone, select your device, and choose Erase iPhone. The device will erase remotely and show the setup screen when it restarts.
What is set up Lock and why do I need my Apple ID password to unlock it?
set up Lock is a security feature that prevents someone else from using your iPhone after erasing it. After you erase, the phone locks and asks for the Apple ID password that was originally used to set it up. This protects your device from theft.