The fastest way to get back into your iPhone
If you have forgotten your iPhone passcode, you cannot retrieve it — Apple does not store it and cannot look it up for you. Instead, you will need to erase your iPhone and set it up again using your Apple ID. The process takes 15 to 30 minutes and works whether you remember your Apple ID password or not.
You have three main routes: use Find My iPhone on another device, use a computer with Finder or iTunes, or take your iPhone to an Apple Store. The route you choose depends on what devices and information you have available right now.
Key Takeaways
- Your iPhone passcode cannot be retrieved because Apple does not store it — you will need to erase the phone and set it up again.
- Find My iPhone on another Apple device is the fastest method if you have access to a Mac, iPad, or another iPhone.
- If you do not have another Apple device, you can use a Windows PC with iTunes or a Mac with Finder to erase and restore your iPhone.
- You will need your Apple ID email and password to complete the setup after erasing, so have those ready before you start.
- If you are locked out of your Apple ID as well, you can still visit an Apple Store with a photo ID to prove ownership and reset everything.
Using Find My iPhone from another device
If you have a Mac, iPad, or another iPhone, this is the quickest route. Open Find My on that device (on Mac, it is in the Applications folder under Utilities; on iPad or iPhone, it is a built-in app). Sign in with your Apple ID if you are not already signed in.
Tap or click Devices at the bottom of the screen, then select your locked iPhone from the list. Tap Erase This Device, confirm your choice, and wait for the process to finish. Your iPhone will restart and show the setup screen. You can then sign in with your Apple ID and restore your data from a backup if you have one.
This method works even if your iPhone is powered off, as long as Find My was turned on before you forgot your passcode. If Find My was never set up, you will need to use one of the other methods below.
Using a computer with Finder or iTunes
On a Mac running macOS 10.15 or newer, connect your iPhone with a USB cable and open Finder. Your iPhone will appear in the sidebar. Click it, then click Restore to erase the phone and read the latest software. On a Mac running an older version of macOS, or on any Windows PC, use iTunes instead — read it from the Microsoft Store (Windows) or the Apple website (older Macs).
In iTunes, connect your iPhone and select it from the device list. Click Restore, confirm that you want to erase and restore, and wait for the process to complete. This can take 10 to 20 minutes depending on your internet speed. When it finishes, your iPhone will restart and show the setup screen.
You will need your Apple ID email and password to complete the setup. If you do not have them, you can still erase the phone this way, but you will not be able to use it until you sign in with your Apple ID credentials.
What to do if you are locked out of your Apple ID too
If you have forgotten both your iPhone passcode and your Apple ID password, you have two options. First, go to iforgot.apple.com on any computer or phone and follow the steps to reset your Apple ID password. You will need access to the email address or phone number associated with your account. This usually takes a few minutes.
If you cannot access that email or phone number, or if you are not sure which Apple ID is on your iPhone, visit an Apple Store with a photo ID. Bring your iPhone as well. Apple Store staff can verify your identity and help you erase the phone and set up a new Apple ID, or help you regain access to your existing one.
Restoring from a backup after you erase
After you erase your iPhone and sign in with your Apple ID, you will see the option to restore from a backup. If you have an iCloud backup, you can choose it from the list and your apps, photos, messages, and settings will restore automatically. This takes 15 minutes to an hour depending on how much data you have.
If you do not have a backup, you can set up your iPhone as new and then read your apps again from the App Store. Your photos and messages will not restore, but your contacts will if they are stored in iCloud.
Preventing this from happening again
Once you have set up your iPhone again, turn on Find My in Settings under your name at the top. This lets you erase your phone remotely if you forget your passcode in the future. Also write down your Apple ID email and password somewhere safe — a password manager like iCloud Keychain, 1Password, or Bitwarden is better than a notebook, but a notebook is better than nothing.
Consider using Face ID or Touch ID instead of a passcode if your iPhone supports it. You still need a passcode as a backup, but you will use it less often and are less likely to forget it.
What happens to your data when you erase
Erasing your iPhone deletes everything on it — apps, photos, messages, and settings all go away. The only things that survive are what you have backed up to iCloud. If you have a recent iCloud backup, you can restore almost everything after you set the phone up again. If you do not have a backup, you will lose anything that was only stored on the phone itself.
Before you erase, check whether you have an iCloud backup by going to Settings on another device signed in with the same Apple ID, then tapping your name and iCloud. If you see a recent backup date, you are covered. If the last backup is very old or missing, you may want to connect to Wi-Fi and let your iPhone back up before you erase it — but you cannot do this if you cannot unlock it.
Frequently Asked Questions
Can I erase my iPhone without a computer or another Apple device?
No, you need either Find My on another device, or a computer with Finder or iTunes. If you have neither, visit an Apple Store with your iPhone and a photo ID. Staff can erase it for you and help you set it up again.
Will erasing my iPhone delete my photos and messages?
Yes, unless you have backed them up to iCloud. If you have an iCloud backup from before you forgot your passcode, you can restore your photos and messages after you erase. If you do not have a backup, they will be gone permanently.
How long does it take to erase and restore an iPhone?
Erasing takes 5 to 10 minutes. Restoring from a backup takes another 15 minutes to an hour depending on how much data you have. Setting up as new takes about 10 minutes.
What if my iPhone is in recovery mode and will not turn on?
Connect it to a computer with Finder or iTunes and follow the restore steps above. The computer will handle the recovery mode and erase the phone for you.
Do I need Wi-Fi to erase and restore my iPhone?
Yes, you need a strong Wi-Fi connection. The erasing itself does not require it, but downloading the latest software and restoring from a backup do. Connect to Wi-Fi before you start the process.