What to Do If You Forget Your iPhone Passcode

If you forgot your iPhone passcode, first try Passcode Reset with your previous passcode if you changed it within the last 72 hours and your iPhone runs iOS 17 or later. Otherwise, erase the iPhone from its Lock Screen if that option is available, or erase and restore it using a computer. There is no way to reveal a forgotten passcode; except for an eligible previous-passcode reset, regaining access requires erasing the iPhone.

Choose the right recovery option

Use this decision path to find the best next step:

  • You changed your passcode within the last 72 hours: Try Passcode Reset with your previous passcode first. If eligible, you can regain access without erasing the iPhone.
  • You can erase the iPhone from its Lock Screen: Use the on-device erase option, then set up the iPhone again and restore a backup if you have one.
  • The Lock Screen erase option is unavailable or doesn’t work: Use recovery mode with a Mac or Windows PC. This erases the iPhone.

Before you start

Make sure you know which account details you may need and what data you could recover.

  • iPhone passcode: Unlocks the device. It is different from your Apple Account password.
  • Apple Account password: May be needed to erase the iPhone from its Lock Screen, restore an iCloud backup, or reactivate the iPhone.
  • Backup and synced data: Erasing removes the data and settings currently on the iPhone. You can restore a backup or recover data synced separately. Data that was neither backed up nor synced may be lost.
  • Avoid random guesses: Incorrect attempts can trigger waiting periods and lockout screens. If Erase Data was enabled in the passcode settings, ten consecutive incorrect attempts can erase the iPhone.
Psssssst :  Why Is the "Forgot Passcode?" or "Erase iPhone" Option Missing on Security Lockout?

Try your previous passcode within 72 hours

This option works on iOS 17 or later if you changed your passcode within the previous 72 hours, the previous passcode has not expired early, and the reset option is available. You’ll use the old passcode temporarily and then set a new one.

  1. On the Lock Screen, enter passcodes until the iPhone Unavailable screen appears. Apple says this screen can appear after five incorrect attempts.
  2. Tap Forgot Passcode? when it appears.
  3. Tap Enter Previous Passcode.
  4. Enter your previous passcode and follow the prompts to set a new one.

Forgot Passcode? may not appear if more than 72 hours have passed, the previous passcode was expired early, or the iPhone does not meet the requirements for this reset flow. The iPhone must be connected to Wi-Fi or cellular, signed in to an Apple Account, and have Find My enabled.


Erase the iPhone from its Lock Screen

This option is available on iOS 15.2 or later when Find My was enabled, the iPhone is connected to Wi-Fi or cellular, and you know the password for the Apple Account associated with it. The process erases the iPhone.

On iOS 17 or later

  1. On the Lock Screen, enter passcodes until iPhone Unavailable appears.
  2. Tap Forgot Passcode?.
  3. On the Security Lockout screen, tap Start iPhone Reset.
  4. Enter your Apple Account password to sign out of the account on the iPhone.
  5. Tap Erase iPhone and follow the prompts.
  6. When the iPhone restarts, set it up again and restore a backup if you have one.

If you use an eSIM on iOS 17 or later, the erase flow may let you choose whether to keep or delete it.

Psssssst :  How to Fix an iPhone "Security Lockout" Countdown Timer That Is Stuck

On iOS 15.2 or iOS 16

If the requirements are met, the Lock Screen may show Erase [Device] instead of Forgot Passcode?. Follow the onscreen prompts to erase the iPhone, then set it up again and restore a backup if available.

If your iPhone uses an eSIM on iOS 16 or earlier, contact your carrier before resetting. Ask how to set up the eSIM again; you may need a QR code from the carrier.


Erase and restore your iPhone with a computer

Use recovery mode if Passcode Reset is unavailable and you can’t erase the iPhone from its Lock Screen. You’ll need a Mac or Windows PC, a cable that can charge the iPhone, and an internet connection. The process can take up to 60 minutes and erases the data currently on the iPhone.

Turn off the iPhone

  • iPhone with Face ID: Press and hold the side button and either volume button until the power-off slider appears, then drag the slider.
  • iPhone with a Home button or top button: Press and hold the side button or top button until the power-off slider appears, then drag the slider.

Put the iPhone in recovery mode

  1. Connect the cable to the computer.
  2. While pressing and holding the button for your iPhone model, connect the cable to the iPhone.
  3. Keep holding the button past the Apple logo until the recovery-mode screen appears. It shows an image of a computer and cable.
iPhone modelButton to hold while connecting
iPhone with Face ID; iPhone 8 or 8 Plus; iPhone SE (2nd or 3rd generation)Side button
iPhone 7 or iPhone 7 PlusVolume Down
iPhone 6s or earlier; iPhone SE (1st generation)Home button
Psssssst :  Why Is "Turn Passcode Off" Greyed Out in iPhone Settings?

If a software download takes more than 15 minutes and the iPhone exits recovery mode, let the download finish. Then turn off the iPhone and repeat the recovery-mode steps.

Restore from the computer

  • On a Mac: Open Finder, select the iPhone in the sidebar, then choose Restore when offered the choice to restore or update.
  • On Windows: Open the Apple Devices app, select the iPhone in the sidebar, choose General, then select Restore. Follow any onscreen prompts.

If you can’t borrow a computer, visit an Apple Store or Apple Authorized Service Provider. If the iPhone’s buttons don’t work and you can’t reach the recovery-mode screen, service may be needed.


Set up the iPhone and recover your data

After erasing or restoring the iPhone, follow Setup Assistant and set a new passcode. Choose the recovery option that matches where your backup is stored:

  • iCloud backup: During setup, choose Restore from iCloud Backup, sign in to your Apple Account, and select a backup.
  • Computer backup: Choose the computer-restore option during setup and follow the prompts in Finder or Apple Devices. If the backup is encrypted, you’ll need its backup password.

If a backup requires a newer iOS version, the iPhone may need to update before the backup can be restored.


Apple Account access and Activation Lock

Erasing an iPhone does not necessarily remove Activation Lock. If Find My was enabled, the Apple Account linked to the iPhone may be required during setup to reactivate it.

If you can’t sign in, try to recover access to that Apple Account. If you can’t remove Activation Lock but have proof of purchase, you can submit an Activation Lock support request to Apple.