A forgotten passcode on an iPhone running iOS 27 can’t be recovered or bypassed, so getting back into your own iPhone means choosing one of Apple’s own routes. If you changed the passcode in the last 72 hours, try this first: Forgot Passcode? > Enter Previous Passcode, which lets you in with the old code and keeps everything on the phone. Every other route erases the iPhone, and each one needs the Apple Account password that was signed in on it, either during the reset or when the phone restarts.
That last point matters more than any button. After an erase, your photos, messages and apps come back only from a backup, and the phone itself only unlocks for the person who knows the Apple Account password. The rest of this page helps you work out which lock you’re facing and which route fits your situation, so you don’t erase a phone you didn’t need to.
First, is it really the passcode?
Several screens look like a lockout but aren’t. Check these before you choose anything that erases data.
- Face ID or Touch ID doesn’t recognize you. That isn’t a lockout. Swipe up, type your passcode, and Face ID starts working again. After a restart, the iPhone always wants the passcode once before it accepts your face.
- “iPhone Unavailable” with a countdown. The phone is making you wait after wrong guesses. Wait for the timer instead of guessing again: each further wrong attempt makes the next wait longer, and after too many attempts the iPhone needs a reset, according to Apple. There’s more on that screen in what the iPhone Unavailable message means and how to clear it.
- “SIM Not Supported” or a carrier lock. This is a different problem. The phone is tied to one carrier’s network, and the fix normally comes from that carrier, not from erasing. Your passcode and data aren’t affected.
If you’re sure the passcode itself is gone, pick a route below.
If Face ID or Touch ID still unlocks it
You aren’t locked out yet, so don’t restart the iPhone or let the battery run flat. Apple’s iPhone User Guide says the passcode is required, and Face ID or Touch ID won’t work, when:
- the iPhone is turned on or restarted
- it hasn’t been unlocked for more than 48 hours
- the passcode hasn’t been used to unlock it in the last 6.5 days and Face ID or Touch ID hasn’t unlocked it in the last 4 hours
- it received a remote lock command
- there have been five unsuccessful attempts to match a face or fingerprint
- someone started Emergency SOS or viewed your Medical ID
Use the time to make sure a current backup exists: open Settings > [your name] > iCloud > iCloud Backup and check that Back Up This iPhone is on, then tap Back Up Now.
Two terms you’ll meet
Activation Lock is the protection that switches on with Find My. It ties the iPhone to your Apple Account (the account Apple used to call Apple ID), so after any erase the phone won’t set up again until someone enters that account’s password. Recovery mode is a special startup state, reached with a button press while the iPhone is connected to a computer, that lets the computer reinstall iOS and wipe the old passcode.
Before routes 2 to 4: what erasing costs you
Warning: erasing deletes everything on the iPhone that isn’t already in an iCloud backup or a computer backup. A locked phone can’t be backed up now, so the most recent backup you made earlier is what you’ll get back. After the erase, the iPhone asks for the Apple Account password that was on it (that’s Activation Lock, described in Apple’s Activation Lock overview).
Forgotten the Apple Account password as well? Sort it out before you erase: a trusted device such as an iPad or Mac signed in to the same account is the quickest way to reset it. If you have no trusted device and can’t verify yourself with details such as your trusted phone number, Apple’s account recovery can take several days or more.
Check what you’ll get back before you erase
You can see how old your last iCloud backup is without touching the locked iPhone. On another device signed in to the same Apple Account:
- iPhone or iPad: Settings > [your name] > iCloud > iCloud Backup, then tap the locked iPhone in the list.
- Mac: System Settings > [your name] > iCloud > Manage > Backups.
- Windows PC: open iCloud for Windows, then Storage > Backups.
The list shows devices with iCloud Backup turned on. If the locked iPhone isn’t there, check that the other device uses the same Apple Account; Apple keeps a device’s iCloud backup for 180 days after iCloud Backup is turned off. Data that already syncs to iCloud isn’t in the backup at all: according to Apple’s list of what iCloud Backup includes, things such as iCloud Photos, Messages in iCloud, iCloud Drive and notes stored in iCloud return when you sign in on the erased iPhone. Anything saved only on the phone after your last backup doesn’t come back.
The routes, from least loss to most
Route 1: you changed the passcode in the last 72 hours
Choose this when you set a new passcode recently and the new one has slipped your mind. It’s the only route that keeps your data.
- Type wrong codes on the Lock Screen until it switches to iPhone Unavailable.
- Tap Forgot Passcode? in the lower corner.
- Tap Enter Previous Passcode and type your old code.
- Follow the prompts to set a fresh passcode.
If the option isn’t offered, more than 72 hours have passed or the passcode was never changed.
Route 2: the iPhone is online and Find My is on
Choose this when the locked iPhone has Wi-Fi or cellular data and Find My was turned on. You need no computer, just the Apple Account password. Apple describes it in resetting an iPhone passcode without a computer.
- On the iPhone Unavailable screen, tap Forgot Passcode?.
- On the Security Lockout screen that follows, tap Start iPhone Reset, then enter your Apple Account password to sign out of the account on the phone.
- Tap Erase iPhone. If the phone has an eSIM, Apple lets you keep it on the phone or remove it with everything else.
Keeping the eSIM can save you a call to the carrier later. No Forgot Passcode? button at all usually means the phone has no connection or Find My is off, so go to route 3.
Route 3: a Mac or a Windows PC and recovery mode
Choose this when Forgot Passcode? isn’t there, or the phone can’t get online. You need a computer with internet access and a cable. On a Mac you use the Finder; on a Windows PC you use the Apple Devices app. iTunes isn’t needed on either. Apple’s page on using a computer to reset your iPhone and passcode has the full sequence.
- Turn the iPhone off.
- Plug the cable into the computer, then into the iPhone, and straight away press and hold the button for your model (table below). Keep holding through the Apple logo until the recovery mode screen shows a computer and a cable.
- On the computer, select the iPhone and choose Restore, not Update. In the Apple Devices app, Restore sits under General.
| iPhone | Button to hold while connecting |
|---|---|
| Face ID models, iPhone 8 and 8 Plus, iPhone SE (second and third generation) | Side button |
| iPhone 7 and 7 Plus | Volume down button |
| Earlier models with a Home button, including the first iPhone SE | Home button |
If the software download takes more than 15 minutes, the iPhone leaves recovery mode on its own. Let the download finish, then put the phone back into recovery mode and choose Restore again. For a second take on this route with a computer, see unlocking an iPhone after forgetting the passcode.
Route 4: Find My on another device or a browser
Choose this when the locked iPhone isn’t in your hands, or you’d rather start the erase from somewhere else. Open Find My on another Apple device and go to Devices, or use Find Devices on iCloud.com in a browser. Pick the iPhone, choose Erase and confirm with your Apple Account password. If the phone is offline, Find My shows Erase Pending and the erase runs the next time it connects to Wi-Fi or cellular. Find My does not unlock the phone: it wipes it, and Activation Lock stays on afterward.
Route 5: no computer and no connection
When none of the above is possible, Apple’s suggestion is an Apple Store or an Apple Authorized Service Provider, where staff can restore the phone for you. Bring the Apple Account password, because you’ll still need it afterward.
Once you’ve picked a route, restoring your backup and setting a new passcode are covered further down this page.
Route notes for older iOS versions and stuck restores
- Route 1 needs iOS 17 or later, a Wi-Fi or cellular connection, the iPhone signed in to your Apple Account and Find My turned on. Apple calls it Passcode Reset; see its page on resetting your passcode with the previous passcode.
- On iOS 16 and the earlier versions that offer route 2, the lockout screen shows Erase iPhone instead of Forgot Passcode?. Tap it and follow the same Apple Account steps. With an eSIM on iOS 16 or earlier, Apple says to ask your carrier for a QR code first so you can set the eSIM up again.
- The buttons don’t respond and the recovery mode screen never appears: Apple says the iPhone might need service. For timing problems and other uses of recovery mode, see putting an iPhone into recovery mode.
- When a computer restore finishes, the iPhone shows the Hello screen. Unplug it and go through setup.
Which route fits
| Your situation | Route | Keeps your data? | What you need |
|---|---|---|---|
| Changed the passcode within 72 hours | 1: Enter Previous Passcode | Yes | The old passcode |
| Phone online, Find My on | 2: Start iPhone Reset on the phone | No, only what’s in a backup | Apple Account password |
| No Forgot Passcode? option | 3: computer and recovery mode | No, only what’s in a backup | Mac or Windows PC, cable, internet, Apple Account password |
| Phone elsewhere or you prefer a remote erase | 4: Find My, Erase | No, only what’s in a backup | Another Apple device or a browser, Apple Account password |
| No computer, no connection | 5: Apple Store or service provider | No, only what’s in a backup | The iPhone, Apple Account password |
| “iPhone Locked to Owner” after an erase | Activation Lock sign-in | Not applicable | The Apple Account and password that were on it |
Activation Lock: the screen after the erase
After routes 2 to 5, the iPhone restarts to setup and may show iPhone Locked to Owner. It’s asking for the Apple Account and password that were signed in before the erase. Enter them and setup carries on.
- Your own phone, password forgotten: recover the Apple Account password first, then return to this screen.
- A used iPhone you bought: only the previous owner can release it, by removing it from their account, according to Apple.
- A work or school iPhone: the organization’s IT team handles it.
For the account side of this, see how Activation Lock is switched off.
Restore your backup and set a new passcode
Once you’re past Activation Lock, setup offers to bring your data back. Apple’s steps are in restoring an iPhone from a backup.
- At Transfer Your Apps & Data, tap From iCloud Backup, sign in to your Apple Account and pick the most recent backup by date.
- For a computer backup instead, connect the iPhone to your Mac or Windows PC, choose Restore Backup in the Finder or the Apple Devices app, and pick the backup. An encrypted backup asks for its password.
- If you bought apps or music with more than one Apple Account, setup asks you to sign in to each. If you don’t know one of those passwords, tap Skip this Step and sign in later.
- Keep the iPhone on Wi-Fi and power. Apps, photos and music keep downloading for a while after setup ends.
- Set a new passcode. To choose a different length or style, go to Settings > Face ID & Passcode (or Touch ID & Passcode) > Change Passcode > Passcode Options.
For help choosing between an iCloud and a computer backup, see restoring an iPhone from a backup.
When it goes wrong
- No Forgot Passcode? on the Lock Screen: the phone has no Wi-Fi or cellular connection, or Find My is off. Use a computer (route 3).
- The computer doesn’t see the iPhone: try another cable or port, then repeat the button hold until the recovery screen appears.
- The iPhone left recovery mode during the download: that happens after 15 minutes. Enter recovery mode again once the download is done.
- The Apple Account password is rejected after the erase: reset it through Apple’s account recovery, then try again.
- “iPhone Locked to Owner” on a second-hand phone: contact the seller; the phone stays locked until they release it.
Fewer lockouts next time
In Settings > Face ID & Passcode (Touch ID & Passcode on a Home-button iPhone), Apple offers an Erase Data switch that wipes the iPhone after ten failed passcode attempts; know whether yours is on. Keep iCloud Backup running so an erase costs you little, and choose a passcode you can actually remember rather than one you’ll need to look up.
Your own iPhone, no passcode: straight answers
Can Apple Support look up my passcode?
No. Apple’s own support pages offer no way to reveal a forgotten passcode, which is why every route except the previous passcode wipes the phone.
Do unlock programs sold online work?
Apple doesn’t offer or endorse them, so this page sticks to Apple’s routes, which cost nothing. Whatever you try, Activation Lock still expects the Apple Account password once the phone is erased.
The old article said iTunes. Do I need it?
No. A Mac uses the Finder, and a Windows PC uses the Apple Devices app.
Will I lose my eSIM?
Only if you choose to. Route 2 asks whether to keep it. After a computer restore, the plan may need setting up again with your carrier.
How long does the computer route take?
Apple allows up to an hour, most of it spent downloading iOS. Keep the phone connected the whole time.
Does waiting out the timer ever unlock the phone?
Waiting only gives you another chance to type the right passcode. If you don’t know it, the timer won’t help.
If you know your Apple Account password and have a recent backup, route 2 or route 3 gets you back in today; start with the one your row in the table points to.
Can I stop someone using my old passcode?
Yes, once you’re back in. Go to Settings > Face ID & Passcode (or Touch ID & Passcode), use Face ID or enter your current passcode, then tap Expire Previous Passcode Now. That also removes the 72-hour safety net of route 1.
Does proof of purchase get my passcode removed?
No. Proof of purchase is what Apple asks for in an Activation Lock support request, when you can’t sign in with the Apple Account the iPhone is linked to after an erase. It doesn’t remove a passcode with your data intact.
I found a locked iPhone. Can I get into it?
No, and nothing legitimate will. Hand it in where you found it or to local police, or contact the owner if their details show on the Lock Screen. Even after an erase, Activation Lock keeps it tied to the owner’s Apple Account.
Matt has been working with WordPress and creating content using this powerful content management system for years. While he has written about many other tech topics, WordPress is one of his favorites.
You can read his full bio here.