An iPhone with a forgotten passcode can usually be opened only by erasing it, then restoring your data from a backup and setting a new passcode.
Getting locked out of an iPhone feels awful. You tap in the code you swear is right, the screen shakes, and a few more tries later you’re staring at “iPhone Unavailable” or “Security Lockout.” The good news is that Apple does give you a clean path back in. The bad news is that there usually isn’t a secret back door.
If you forgot the passcode, the fix is not “guess better.” The fix is to erase the phone in the right way, then set it up again. If you have a recent backup, you can get most or all of your stuff back. If you don’t, you can still regain access to the phone itself, but the data stored only on that device is gone.
This article walks through the working routes, the dead ends, and the details that trip people up most often, like eSIM choices, Activation Lock, and what changes if you recently set a new passcode.
What Actually Works When You Forget An iPhone Passcode
Apple treats the device passcode as a security wall. That means there is no built-in “show me my passcode” option, no safe bypass, and no magical app that opens the phone while keeping all your data in place. If a site claims that, close the tab.
In plain terms, you have three real paths:
- If the iPhone runs a recent version of iOS and is online, you may be able to erase it right from the lock screen with your Apple Account details.
- If that option is not there, you can connect the iPhone to a Mac or Windows PC, place it in recovery mode, and restore it.
- If you changed your passcode in the last 72 hours on iOS 17 or later, there may be a one-time path using the previous passcode.
That’s the whole map. Everything else is a variation of those routes.
How To Unlock An iPhone If You Forgot The Password On Newer iPhones
The smoothest route is the lock-screen reset path. This works on devices using iOS 17 or later, or a related erase option on iOS 15.2 and later, as long as the phone is connected to Wi-Fi or cellular and Find My was already turned on.
After enough failed attempts, the phone shows an unavailable screen. On recent versions, you’ll see a “Forgot Passcode?” option. Tap it, confirm the reset, sign out with your Apple Account password, then erase the device. After the restart, you can set it up again and restore from a backup if you have one.
This route is handy because you do not need a cable or computer. It also cuts out a lot of hassle if you’re traveling or away from your desk. Apple spells out the steps on its passcode reset screen instructions, including the network and Find My requirements.
When This Lock-Screen Reset Option Appears
You won’t always see it right away. The phone has to reach the unavailable state first, and the device has to meet Apple’s conditions. If the iPhone is offline, if Find My was never enabled, or if the software is too old, this path may not show up at all.
That’s why two people with “the same problem” can see two different screens. One gets a neat on-device reset button. The other gets a brick that seems to want a computer. Both are normal.
What You Need Before You Tap Erase
Pause for a minute and think through your backup situation. Once the erase starts, it wipes the phone. If your photos, notes, messages, or app data were syncing to iCloud or backed up to a computer, you’re in much better shape. If not, this step still gets you back into the iPhone, but it does not rescue data that exists only on that locked device.
Also watch the eSIM prompt. On newer versions, you may get a choice to keep the eSIM while erasing the data. That can make setup much easier after the reset.
When A Computer Is The Only Way Back In
If the iPhone is too old for the lock-screen erase path, if it is offline, or if the passcode reset option refuses to appear, use recovery mode on a Mac or Windows PC. This is Apple’s standard reset method for forgotten passcodes.
You turn the phone off, connect it with a cable, then hold the right hardware button while plugging in or while the device starts. Keep holding until you reach the recovery mode screen with the cable-and-computer image. From there, Finder on a Mac or Apple Devices on Windows lets you restore the iPhone.
The restore process erases the device and installs the software needed to start fresh. If the download takes long enough that the phone exits recovery mode, let the download finish, then repeat the recovery mode step and restore again. That detail trips up a lot of people because it can feel like the reset “failed” when it really just timed out during download.
Apple’s current recovery mode steps vary by model, and the exact button you hold depends on whether you have Face ID, an iPhone 7 series device, or an older model with a Home button.
Recovery Mode Buttons By iPhone Model
Here’s the fast version so you can check your model before you start.
| iPhone Model Group | Button To Hold For Recovery Mode | What You’ll Use After Connection |
|---|---|---|
| iPhone with Face ID | Side button | Finder on Mac or Apple Devices on Windows |
| iPhone 8 | Side button | Finder on Mac or Apple Devices on Windows |
| iPhone 8 Plus | Side button | Finder on Mac or Apple Devices on Windows |
| iPhone SE 2nd generation | Side button | Finder on Mac or Apple Devices on Windows |
| iPhone SE 3rd generation | Side button | Finder on Mac or Apple Devices on Windows |
| iPhone 7 | Volume down button | Finder on Mac or Apple Devices on Windows |
| iPhone 7 Plus | Volume down button | Finder on Mac or Apple Devices on Windows |
| iPhone 6s and earlier | Home button | Finder on Mac or Apple Devices on Windows |
| iPhone SE 1st generation | Home button | Finder on Mac or Apple Devices on Windows |
How The Recovery Restore Usually Plays Out
On a Mac, open Finder and pick the iPhone from the sidebar. On Windows, open Apple Devices, choose the iPhone, then hit Restore. The software may ask whether you want to Restore or Update. For a forgotten passcode, restore is the route that matters.
Once the process finishes, the iPhone reboots to the Hello screen. From there, you set it up again, choose your language and network, sign in with your Apple Account, and restore from a backup if one is available.
If you need Apple’s exact wording for the model-specific steps, the current version is on Apple’s recovery mode passcode page. It also lists what to do if your buttons do not respond or the device will not enter recovery mode.
The 72-Hour Shortcut Many People Miss
If you changed your passcode recently and then forgot the new one, Apple has a small grace window on iOS 17 and later. For up to 72 hours after the change, the previous passcode can sometimes be used one time to get back in and set a new passcode again.
This does not help if the passcode has been forgotten for weeks. It also does not help if you never changed the code recently. Still, it is worth checking because it can spare you a full erase. A lot of people change the passcode, use Face ID for a few days, then blank when the phone asks for the code again. That is the exact situation where this feature matters.
If that sounds like you, try the previous passcode before you erase anything. If it works, reset the passcode right away and write the new one somewhere safe.
What Happens To Your Data After The Reset
This is the part that matters most. Erasing the iPhone removes the data and settings stored on it. What comes back depends on what was backed up or synced elsewhere.
If you use iCloud Backup, you may be able to restore most of your content during setup. If you back up to a Mac or PC, you can restore from that computer. If your photos were syncing to iCloud Photos, those can reappear after sign-in. The same goes for contacts, calendars, notes, and other items that were syncing to iCloud instead of living only on the handset.
If there was no backup and no sync, there is no clean route to pull fresh data off a locked, encrypted iPhone after the passcode is forgotten. That can sting, but it is part of the same security system that keeps strangers out of your phone.
| Item On Your iPhone | What Happens After Erase | Best Chance Of Getting It Back |
|---|---|---|
| Apps | Removed from the device | Re-download from App Store after sign-in |
| Photos and videos | Removed from the device | Restore from backup or iCloud Photos sync |
| Messages | Removed from the device | Restore from backup or Messages in iCloud if enabled |
| Contacts and calendars | Removed from the device | Sync back from iCloud, Google, Exchange, or backup |
| Offline downloads | Removed from the device | Download again from the app or service |
| eSIM | May be kept or deleted, based on the reset choice and iOS version | Keep eSIM during erase if the option appears, or reactivate with carrier |
Activation Lock Can Stop You After The Erase
Plenty of people think the hard part ends when the iPhone is erased. Not always. After setup starts, Apple may ask for the Apple Account linked to the phone. That is Activation Lock. It turns on with Find My and is meant to stop a stolen or lost phone from being set up by someone else.
If the iPhone is yours and you know your Apple Account email or phone number plus the password, you’re fine. Sign in and finish setup. If you forgot that password too, reset it before or during setup on another trusted device or on Apple’s account pages.
If the phone belonged to someone else, you need the previous owner to remove it from their account. An erased iPhone that still says “iPhone Locked to Owner” is not ready for a new user yet. That is not a glitch. It is the security feature doing its job.
What If You Forgot Both The Passcode And Apple Account Password
That’s rough, but it’s still fixable. First erase the iPhone using the lock-screen method or recovery mode. Then reset the Apple Account password using a trusted Apple device, a borrowed device with Apple’s app, or the web route if needed. After that, return to the iPhone setup screen and sign in.
If your account is locked, inactive, or disabled, sort that out before you expect the setup to finish. An erased phone without the right Apple Account access is still stuck.
Mistakes That Make This Problem Worse
The worst move is hammering random passcode guesses for twenty minutes while stressed out. That only drags the lockout timer and can push you toward a full unavailable state faster. If your first few serious guesses fail, stop and switch to recovery planning.
Another bad move is paying for shady “unlock software.” Most of these tools either do nothing, try to sell you a download you do not need, or just walk you into the same erase process Apple already gives away for free.
One more trap: borrowing a used iPhone without checking whether it is still tied to someone else’s account. If the phone is locked to a prior owner, no passcode reset trick will turn it into your phone.
How To Avoid Getting Stuck Again
Once you’re back in, fix the weak spots right away. Pick a passcode you can recall under stress, not just on a normal day. Turn on iCloud Backup if it is off. Check that Find My is enabled. Make sure your Apple Account email, phone number, and trusted contacts are current.
If you just changed your passcode, test your memory once or twice later that day instead of leaning only on Face ID. That small habit can save a lot of pain.
You should also give some thought to backup timing. A backup from last night is a mild annoyance. No backup for six months is a whole different story.
Choosing The Right Fix For Your Situation
If the iPhone shows “Forgot Passcode?” and you know your Apple Account password, use the on-device erase route. It is the cleanest path.
If that option is missing, use a computer and recovery mode. If you changed the passcode in the last 72 hours, try the previous passcode first. If the phone is activation locked after erase, sign in with the linked Apple Account or get the prior owner to remove it from their account.
That is how to unlock an iPhone if you forgot the password in the real world: not with a trick, but with the right reset path, a backup if you have one, and the linked Apple Account ready for setup.
References & Sources
- Apple.“If You See An iPhone Unavailable Message Or Security Lockout Screen.”Lists the on-device erase path for iOS 15.2 and later, plus the newer “Forgot Passcode?” flow on iOS 17 and later.
- Apple.“If You Forgot Your iPhone Passcode Or Your iPhone Is Disabled.”Shows the recovery mode restore steps by iPhone model and explains that regaining access requires resetting the device.
