Your iPhone password is not stored anywhere you can look it up
Apple does not keep a record of your iPhone passcode, and neither does your device in a way you can retrieve. When you set a passcode, Apple encrypts it so thoroughly that even Apple's own engineers cannot read it back to you. This is intentional — it protects your phone if it is lost or stolen, because no one, including Apple, can bypass the encryption to guess your code.
If you have forgotten your passcode, you cannot recover it by looking in Settings, checking your Apple ID account, or calling Apple Support. The only way forward is to erase your iPhone and set it up again, which means you will create a new passcode from scratch.
Key Takeaways
- Apple encrypts your passcode so completely that it cannot be retrieved, even by Apple itself.
- If you forget your passcode, you must erase your iPhone and set it up as new or from a backup.
- You can erase your iPhone through iCloud.com if you do not have the device in front of you.
- A backup from before you forgot the passcode will restore your apps and data, but not the old passcode.
- If you remember any passcode you have used on that Apple ID account, try those first — many people reuse codes across devices.
Why Apple does not store your passcode
Your passcode is the master key to everything on your phone — your messages, photos, payment methods, and health data. If Apple kept a copy, hackers who broke into Apple's systems could use it to unlock millions of phones. By making the passcode impossible to recover, Apple ensures that only you can ever unlock your device.
This design choice means Apple cannot help you if you forget. Support staff cannot reset your passcode the way they might reset a password to your email or Apple ID account. The passcode is separate from your Apple ID password, and one does not unlock the other.
Erasing your iPhone to set a new passcode
To regain access to your phone, you will need to erase it completely and start over. You have two paths depending on whether you have the device in your hands.
If your iPhone is in front of you, go to Settings, tap General, scroll to the bottom, and tap Transfer or Reset. Choose Erase All Content and Settings. You will be asked to enter your Apple ID password — this is different from your passcode, and you should know it because you use it to sign into iCloud or the App Store. After you enter it, your phone will erase itself.
If you do not have your iPhone, go to iCloud.com from any computer or another device, sign in with your Apple ID, click Find My, select your iPhone, and choose Erase This Device. You will need your Apple ID password, not your passcode. Once the erase is complete, you can set up the phone again and create a new passcode.
Restoring your data after erasing
Erasing your iPhone does not have to mean losing your photos, contacts, and messages. If you backed up your phone before you forgot the passcode, you can restore from that backup during setup. When you turn on your erased iPhone, you will see the option to restore from iCloud backup or from a computer backup made in Finder or iTunes.
Choose the most recent backup that was made before you forgot your passcode. Your apps, photos, messages, and settings will come back — but the old passcode will not. You will create a brand new passcode during setup, and that is the one you will use going forward.
If you have never backed up your phone, you will lose any data that was not synced to iCloud automatically — such as photos stored only on the device, notes, and some app data. This is another reason to turn on iCloud backup now, even after you have set your new passcode.
Passcodes versus Apple ID passwords
Many people confuse these two because they both protect your iPhone, but they work differently. Your passcode is the 4, 6, or custom-digit code you enter every time you unlock your phone. Your Apple ID password is what you use to sign into iCloud, the App Store, and Apple's website.
You need your Apple ID password to erase your iPhone and set up a new passcode. If you have forgotten your Apple ID password as well, you can reset it at iforgot.apple.com before you try to erase your phone. If you have forgotten both, contact Apple Support — they can verify your identity and help you reset your Apple ID password, which will then let you erase your phone and create a new passcode.
Preventing this from happening again
Once you have set a new passcode, write it down and store it somewhere safe — a physical notebook at home, a password manager like 1Password or Bitwarden, or even a note to a trusted family member. Do not store it in a note on your iPhone itself, because you will not be able to read it if you forget the passcode.
Consider using Face ID or Touch ID instead of typing a passcode every day. These biometric methods are more find than a code you might forget, and they still protect your phone if it is lost. You will still need to know your passcode for setup and for situations where your face or fingerprint does not work, but you will use it far less often.
Turn on iCloud backup in Settings under your name, then iCloud, then iCloud Backup. This way, if you ever need to erase your phone again, your data will be waiting to restore.
Frequently Asked Questions
Can Apple Support reset my passcode for me?
No. Apple Support cannot reset your passcode because Apple does not store it. They can help you erase your phone if you have forgotten both your passcode and your Apple ID password, but you will still need to set a new passcode during setup.
What if I remember part of my passcode?
Try entering what you remember. After six failed attempts, your iPhone will lock you out for 1 minute. After more failures, the wait times grow longer. If you are certain of a few digits, try different combinations of those digits first before erasing.
Will restoring from backup give me back my old passcode?
No. Your passcode is not part of a backup. When you restore from backup, you get your apps and data back, but you create a completely new passcode during setup. This is by design — it prevents someone from restoring a stolen phone and using the old passcode to unlock it.
Can I use my Apple ID password as my iPhone passcode?
You can, but it is not recommended. Your Apple ID password is longer and more complex, which makes it harder to type on your phone every day. Keep them separate — use a straightforward passcode for your phone and a strong password for your Apple ID.
What if I do not remember my Apple ID password either?
Go to iforgot.apple.com and follow the steps to reset it. You will need access to the email address or phone number associated with your Apple ID. Once you reset your Apple ID password, you can use it to erase your iPhone and set a new passcode.