Forgot iPhone Passcode? How to Unlock It (2026)
Short answer: Forgot iPhone passcode? There is no way to recover a forgotten passcode without erasing the phone, with one exception: on iOS 17 or later, if you changed your passcode within the last 72 hours, your old passcode still works. Otherwise, you must erase the iPhone using the lock-screen reset, a computer in recovery mode, or iCloud Find My, then restore from a backup. If you are facing other iPhone issues, the iPhone problems hub covers the common fixes in one place.
Can You Unlock an iPhone Without the Passcode?
Let us be direct, because this is where most guides mislead you: there is no secret code, hack, or tool that bypasses the iPhone passcode. Apple’s encryption ties your data to the passcode itself. Anyone promising a no-erase unlock is either selling snake oil or describing something that wipes your phone.
Your real options depend on your situation. This table tells you which method fits:
| Method | iOS needed | Computer needed | Data loss | Requirements |
|---|---|---|---|---|
| Previous passcode (72h) | iOS 17+ | No | None | Changed passcode within 72 hours |
| Erase from Lock Screen | iOS 15.2+ | No | Full erase | Apple ID password, Wi-Fi or cellular |
| Recovery mode + computer | Any | Yes | Full erase | Mac or Windows PC |
| iCloud Find My erase | Any | No | Full erase | Find My enabled, Apple ID access |
Try them in this order. Method 1 is the only one that saves your data.
Method 1: Use Your Previous Passcode (iOS 17+, Within 72 Hours)
Since iOS 17, Apple gives you a 72-hour grace period after changing your passcode. Your old code keeps working during that window, and using it lets you set a new code without erasing anything. This is the first thing to try if you recently changed your passcode and immediately forgot the new one.
Requirements: iPhone running iOS 17 or later, still inside the 72-hour window, connected to Wi-Fi or cellular, signed in to an Apple Account, with Find My turned on. It will not work if you already tapped “Expire Previous Passcode Now” in Settings.
- Enter wrong passcodes until you see the iPhone Unavailable screen (it appears after several failed attempts; respect any waiting timer shown).
- Tap Forgot Passcode? in the bottom corner of the screen.
- Tap Enter Previous Passcode (this option only appears if you changed your passcode within the last 72 hours).
- Enter your old passcode.
- Follow the prompts to set a new passcode immediately.
Lock the phone and unlock it with the new code to confirm. Your photos, messages, and apps are all still there. Act fast, because the moment the 72 hours expire, this option disappears permanently.
Method 2: Erase iPhone from the Lock Screen (iOS 15.2+)
If the 72-hour window has passed (or never applied), the lock screen itself offers an erase option on iOS 15.2 and later. This wipes the phone completely, after which you restore from a backup.
- Keep entering wrong passcodes until the iPhone Unavailable or Security Lockout screen appears.
- Tap Erase iPhone (on iOS 17+ it may appear under Forgot Passcode?).
- Tap Erase iPhone again to confirm.
- Enter your Apple ID password to sign out of your Apple Account and disable Activation Lock.
- Wait for the erase to finish. The phone restarts to the setup screen.
After erasing, restore your data from an iCloud or computer backup during setup. Without a backup, your data is gone, which is why regular backups matter so much (more on that below).
Method 3: Restore with a Computer (Recovery Mode)
Use this when the lock-screen erase option is unavailable, for example on older iOS versions, or when you have no network connection. You will need a Mac (Finder) or a Windows PC (Apple Devices app or iTunes).
Step 1: Put the iPhone in recovery mode. The button combination depends on your model:
- iPhone 8 and later (all Face ID models, SE 2nd/3rd gen): press and release Volume Up, press and release Volume Down, then press and hold the Side button until you see the recovery-mode screen (cable pointing at a computer icon).
- iPhone 7 / 7 Plus: press and hold the Side button and Volume Down together until the recovery screen appears.
- iPhone 6s and earlier: press and hold the Home button and the Top (or Side) button together until the recovery screen appears.
Step 2: Connect to the computer with a cable and open Finder (Mac) or Apple Devices/iTunes (Windows). A prompt will say a problem was detected.
Step 3: Click Restore. The computer downloads the latest iOS and wipes the phone. If the download takes more than about 15 minutes, the phone may exit recovery mode; repeat Step 1.
Step 4: When it finishes, the phone restarts to the setup screen. Restore from a backup.
Method 4: Erase with iCloud Find My
If Find My was enabled and you can sign in to your Apple Account from another device, you can wipe the phone remotely with no computer and no cable.
- Go to icloud.com/find and sign in with the Apple Account used on the locked iPhone.
- Select the iPhone from the device list.
- Click Erase This Device and confirm.
- After the erase completes, the phone restarts to the setup screen, ready to restore from a backup.
This is also the method to use if the phone was lost or stolen and you need to protect your data.
What About Activation Lock After Erasing?
Erasing removes the passcode, but Activation Lock stays on. During setup, the phone will ask for the Apple Account and password that were signed in before the erase. This is Apple’s theft protection, and it cannot be bypassed legitimately.
So before you erase, make sure you know your Apple Account credentials. If you forgot those too, start account recovery at Apple’s account site first, because a wiped iPhone you cannot activate is just an expensive paperweight.
How to Never Get Locked Out Again
- Back up regularly. iCloud Backup (Settings > [your name] > iCloud > iCloud Backup) means an erase costs you an hour of restoring, not your memories.
- Write the passcode down somewhere safe, a password manager or a piece of paper in a drawer, until the new code is in muscle memory.
- Do not change your passcode casually. Every change starts a new 72-hour window, but it also starts a new chance to forget.
- Know your Apple Account password. It is the master key for every recovery method above.
Can Apple unlock my iPhone if I forgot the passcode?
No. Apple cannot bypass the passcode or recover it for you. Apple Support will walk you through the same erase methods in this guide. Bring proof of purchase if you visit a store; they still cannot unlock it without erasing.
Will I lose my photos if I erase my iPhone?
Only if you have no backup. Erasing deletes everything on the phone, but anything in iCloud (Photos, contacts, etc.) or in an iCloud/computer backup comes back when you restore during setup.
What if Find My iPhone was turned off?
You cannot use the lock-screen erase or iCloud erase methods. Recovery mode with a computer (Method 3) still works, since it does not depend on Find My.
How long does the iPhone Unavailable lockout last?
The lockout timer escalates: 1 minute, 5 minutes, 15 minutes, 1 hour, and longer with repeated failures. If you turned on the Erase Data option under Face ID & Passcode settings, 10 failed attempts wipes the phone automatically.
Does erasing remove the Apple ID from the phone?
If you erase via the lock screen or iCloud with your Apple ID password, Activation Lock is removed properly. If you erase via recovery mode, Activation Lock remains, and you will need the Apple Account credentials during setup.
Do third-party iPhone unlocker tools work?
They all erase the phone, exactly like Apple’s free methods, and some are scams or install malware. There is no tool that preserves your data; Apple’s encryption makes that impossible. Save your money.
I never backed up. Is my data gone forever?
Unfortunately, yes, for anything stored only on the phone. Photos synced to iCloud Photos and data synced to iCloud (contacts, notes, etc.) survive independently of backups, so check iCloud.com after signing in.
The Bottom Line
A forgotten iPhone passcode means erasing the phone, unless you are inside the 72-hour window on iOS 17+. Try the previous-passcode reset first, it is the only method that keeps your data.
After that, the lock-screen erase, recovery mode, and iCloud erase all do the same job: wipe the phone so you can start over from a backup. The real lesson is the boring one: keep backups current and know your Apple Account password, because those two things turn a disaster into an inconvenience.
