If you are locked out of your iPhone passcode, use Passcode Reset with your old passcode if you changed it in the last 72 hours; otherwise you must erase the iPhone, either from the Security Lockout screen or with a computer in recovery mode, then restore your data from a backup.
This guide covers all three Apple routes, which one fits your iPhone, how to get your data back, Activation Lock after the erase, and what to do when a step will not appear.

Unlock a locked iPhone with Passcode Reset
Passcode Reset works on iOS 17 and later when you changed the passcode within the last 72 hours. It keeps all your data.
- On the Lock Screen, keep entering a passcode until the iPhone Unavailable screen appears after five incorrect attempts.
- Tap Forgot Passcode? in the bottom corner of the screen.
- Tap Enter Previous Passcode.
- Enter your old passcode.
- Follow the onscreen instructions to set a new passcode immediately.
Forgot Passcode? appears only when the iPhone is connected to cellular or Wi-Fi, signed in to your Apple Account, and has Find My turned on. If you have not changed the passcode in the last 72 hours, use one of the reset methods below.

Which iPhone passcode recovery method should you use?
| Your situation | Method | Data kept? |
|---|---|---|
| Changed the passcode in the last 72 hours, iOS 17 or later | Passcode Reset with the old passcode | Yes |
| iOS 17 or later, online, Find My on, you know your Apple Account password | Start iPhone Reset from the Security Lockout screen | No, restore from backup |
| iOS 15.2 or iOS 16, online, Find My on | Erase iPhone on the lockout screen | No, restore from backup |
| No network, Find My off, or older iOS | Recovery mode restore with a Mac or Windows PC | No, restore from backup |
| No computer available | Apple Store or Apple Authorized Service Provider | No |
Apple's order is the same: try Passcode Reset first, then the on-device reset, then a computer.
What you need to reset a locked iPhone
| Route | Requirements |
|---|---|
| Passcode Reset | iOS 17 or later, passcode changed within 72 hours, old passcode, network connection, Apple Account signed in, Find My on |
| Reset on the iPhone | iOS 15.2 or later, Find My previously enabled, active cellular or Wi-Fi connection, Apple Account and password |
| Reset with a computer | Mac or Windows PC, a cable that can charge the iPhone, internet connection, up to 60 minutes |
| Windows PC | Apple Devices app from the Microsoft Store |
| Getting data back | An iCloud backup or a backup on your computer made before the lockout |
Reset a locked iPhone without a computer (Security Lockout)
This erases the iPhone from the lock screen. On iOS 16 or earlier with an eSIM, contact your carrier first and ask for a QR code to set up the eSIM again.
- Enter a passcode on the Lock Screen until iPhone Unavailable appears.
- Tap Forgot Passcode? when it appears.
- On the Security Lockout screen, tap Start iPhone Reset.
- Enter your Apple Account password to sign out of your Apple Account on the iPhone.
- Tap Erase iPhone; with an eSIM on iOS 17 or later, choose whether to keep or delete the eSIM.
- After the restart, follow the setup steps, restore from a backup, and set a new passcode.
On iOS 15.2 and iOS 16 the lockout screen shows Erase iPhone directly instead of Forgot Passcode?.

Reset iPhone passcode with a computer in recovery mode
Use this when the iPhone cannot show Forgot Passcode?. It erases the iPhone and reinstalls iOS.
- Turn off the iPhone: on Face ID models, hold the side button and Volume down button until the slider appears; on Home button models, hold the top or side button. Drag the slider.
- Connect the cable to your Mac or Windows PC, then to the iPhone, and immediately hold the correct button (see the table below). Do not release it.
- Keep holding through the Apple logo until the image of a computer and a cable appears.
- On a Mac, open a Finder window and select the iPhone under Locations; on Windows, open Apple Devices and select the iPhone.
- Choose Restore when offered Restore or Update, and follow the onscreen instructions.
- When the Hello screen appears, disconnect the iPhone and set it up.
The iOS download can take more than 15 minutes. If the iPhone leaves the recovery screen before it finishes, let the download complete, turn the iPhone off and enter recovery mode again.

Recovery mode button for each iPhone model
| iPhone model | Button to hold after connecting the cable |
|---|---|
| iPhone with Face ID | Side button |
| iPhone 8, iPhone 8 Plus, iPhone SE (2nd and 3rd generation) | Side button |
| iPhone 7, iPhone 7 Plus | Volume down button |
| iPhone 6s and earlier, iPhone SE (1st generation) | Home button |
If the buttons do not respond, the screen stays black, or the computer-and-cable screen never appears, the iPhone may need service. The same button layouts are used to force restart an iPhone that is frozen.
Restore your data after resetting the iPhone passcode
- Turn on the erased iPhone and follow the setup steps until the Transfer Your Apps & Data screen.
- Tap From iCloud Backup and sign in to your Apple Account.
- Choose the most recent backup by date and size.
- Sign in again when asked to restore apps and purchases.
- Keep the iPhone on Wi-Fi and power until the progress bar finishes.
- Set a new passcode you can remember.
For a computer backup, open Finder on a Mac with macOS Catalina or later, or Apple Devices on Windows 10 or later, select the iPhone, click Restore Backup, choose the backup and click Restore. Without any backup, data on the iPhone cannot be recovered after the erase.

How to check the iPhone is unlocked and ready
- Lock the iPhone and unlock it with the new passcode.
- Open Settings > Face ID & Passcode (or Touch ID & Passcode) and confirm the passcode settings open with the new code.
- Check that Settings shows your name, which confirms the Apple Account is signed in.
- Open Photos and Messages to confirm the backup content is downloading.
- Make sure Find My is on again under Settings > your name.
What happens after too many wrong iPhone passcode attempts
| Stage | What you see | What it means |
|---|---|---|
| Five incorrect attempts | iPhone Unavailable screen | Passcode Reset or Forgot Passcode? can appear if conditions are met |
| Lockout with network and Find My | Security Lockout with Forgot Passcode? or Erase iPhone | You can erase the iPhone without a computer |
| Ten failed attempts with Erase Data on | iPhone erases itself | Set up again and restore a backup |
| Ten failed attempts with Erase Data off | iPhone must be restored on a computer | Use recovery mode |
| After any erase with Find My on | Activation Lock asks for the Apple Account | Only the owner's Apple Account password reactivates it |
Fix iPhone passcode reset problems
Forgot Passcode? or Erase iPhone does not appear
The iPhone is offline, Find My is off, or iOS is older than 15.2.
- Confirm the iPhone has an active cellular or Wi-Fi connection; the option needs one.
- Remember that Find My must have been turned on before the lockout; it cannot be turned on now.
- If the option still does not appear, use recovery mode with a computer.
Enter Previous Passcode is missing or the old passcode fails
More than 72 hours have passed since the change, or the old passcode was expired early.
- Tap Forgot Passcode? and choose Start iPhone Reset instead.
- Or restore the iPhone in recovery mode with a computer.
The iPhone exits recovery mode during the restore
The iOS download took more than 15 minutes.
- Let the download finish on the computer.
- Turn off the iPhone.
- Enter recovery mode again and choose Restore.
Computer-and-cable screen never appears
The wrong button for the model, or the buttons do not respond.
- Check the button table above for your model.
- Connect the cable to the computer first, then to the iPhone, and hold the button immediately.
- If it still fails, contact Apple to get service.
Asked for an Apple Account after the reset
Activation Lock is on because Find My was on.
- Enter the Apple Account and password used on the iPhone.
- If you forgot the password, reset your Apple Account password first.
- On a used iPhone, ask the previous owner to remove it from their account.
Locked out of iPhone passcode FAQ
How do I unlock my iPhone if I forgot my passcode?
Use Passcode Reset with your old passcode if you changed it in the last 72 hours on iOS 17 or later. Otherwise erase the iPhone from the Security Lockout screen or in recovery mode with a computer, then restore your backup.
Can I unlock a locked iPhone without losing data?
Only with Passcode Reset, which needs iOS 17 or later and a passcode changed within the last 72 hours. Every other route erases the iPhone, so your data comes back only from an iCloud or computer backup.
Can I reset my iPhone passcode through iCloud?
Yes, in effect. With iOS 15.2 or later, Find My on and a network connection, the lockout screen offers Forgot Passcode? or Erase iPhone. You confirm with your Apple Account password, and the iPhone erases itself.
Will I lose everything if I am locked out of my iPhone?
The erase deletes everything on the iPhone, but anything in an iCloud backup or a computer backup can be restored during setup. Photos and other content in iCloud also download again after you sign in.
How many wrong passcode attempts before an iPhone erases itself?
Ten, if Erase Data is turned on in Face ID & Passcode settings. If it is off, the iPhone must be restored on a computer after ten failed attempts. The iPhone Unavailable screen appears after five.
Can I use recovery mode without iTunes?
Yes. On a Mac with a recent macOS, recovery mode restores run in Finder. On a Windows PC, use the Apple Devices app from the Microsoft Store. Select the iPhone and choose Restore.
What if my new iPhone is locked with a passcode?
A used iPhone that shows a passcode Lock Screen has not been erased. Ask the seller to erase it and remove it from their Apple Account. Do not take ownership while it shows iPhone Locked to Owner.
What should I do if I found an iPhone locked with a passcode?
You cannot unlock it, and Activation Lock stops anyone but the owner from reactivating it. If the screen shows a Lost Mode message with a phone number, use it to contact the owner.
Can Apple unlock my iPhone passcode?
Without the passcode, the only route that keeps data is Passcode Reset; every other option erases the iPhone. If you have no computer and cannot borrow one, an Apple Store or Apple Authorized Service Provider can help with the restore.
Bottom line: best way to get back into a locked iPhone
Try Passcode Reset first, then Start iPhone Reset on the lockout screen, and use recovery mode with a computer only when neither appears. Passcode Reset is the only route that keeps your data, and the on-device reset avoids a computer; recovery mode always works but needs a Mac or PC and the longest time.





