"I forgot my iPhone passcode." "I entered it wrong too many times and now the phone is locked." If you're in this situation, the only way out is to follow Apple's official recovery process. There is no workaround or third-party tool that extracts or bypasses a passcode — the only solution is to fully erase the device and set it up again. This guide covers iOS 17/18 iPhones and walks you through the on-device erase option, recovery via Mac or Windows PC, and exactly what to expect when restoring from backup.
Table of Contents
- What to know before you start
- When "iPhone Unavailable" appears
- Method 1: Erase directly on the iPhone (iOS 15.2 or later)
- Method 2: Erase via Mac (Finder)
- Method 3: Erase via Windows PC (iTunes or Apple Devices)
- How to enter Recovery Mode (by model)
- Restoring after the erase
- How to avoid this in the future
- Frequently asked questions
- Summary
What to know before you start
A full erase is always required
The iPhone passcode is used as part of the device's encryption key, which means even Apple cannot retrieve it. If you've forgotten your passcode, the only path forward is to erase the iPhone completely and set it up from scratch. There is no "passcode-only reset" and no legitimate unlocking tool — accept that an erase is coming and focus on getting through it cleanly.
Your backup determines how much you recover
Erasing removes everything on the iPhone — apps, photos, contacts, messages, and more. Whether you can get any of it back depends entirely on whether you have a recent backup.
- iCloud backup enabled: You can restore to the state of the most recent automatic backup.
- PC or Mac backup on hand: You can restore to the date of that backup.
- No backup at all: Data synced via iCloud (contacts, calendar, notes, some photos) will come back when you sign in. Anything stored only inside individual apps — game saves, LINE chat history, and so on — is gone for good.
You cannot create a backup right now because you can't get into the phone. Go into this process understanding that data will revert to the last backup you made, not to the state the phone is in today.
Your Apple ID password is mandatory
Every iPhone running iOS 7 or later has Activation Lock. After the erase, anyone who turns the phone on must sign in with the Apple ID that was linked to it. If you don't know your Apple ID password, you'll be stuck at a blank activation screen after the erase. Before you do anything else, confirm that you can sign in to your Apple ID. If you've forgotten the password, reset it at iforgot.apple.com from another device first.
When "iPhone Unavailable" appears
Failed attempts and lockout times
Entering the wrong passcode repeatedly triggers progressively longer lockouts.
| Failed attempts | Message shown | Wait time |
|---|---|---|
| 1–5 | Normal entry allowed | — |
| 6 | iPhone Unavailable | 1 minute |
| 7 | iPhone Unavailable | 5 minutes |
| 8 | iPhone Unavailable | 15 minutes |
| 9 | iPhone Unavailable | 60 minutes |
| 10 | iPhone Unavailable (erase or connect) | Cannot unlock |
After 10 consecutive failures, the lock cannot be cleared by waiting — you must erase the device. If you have a strong hunch about the passcode, try it a couple of times, but if it doesn't come to you within two or three attempts, move straight to the erase process rather than burning more attempts.
When "Erase iPhone" appears on the lock screen
On iOS 15.2 and later, a "Erase iPhone" option may appear in the lower-right corner of the lock screen. It requires all of the following:
- iOS 15.2 or later installed
- At least 7 consecutive failed passcode attempts (the "unavailable" wait screen must be showing)
- iPhone connected to Wi-Fi or cellular data (online)
- An Apple ID signed in on the device
If all conditions are met, use Method 1 below. If the button isn't there, skip to Method 2 or 3 (Mac or Windows PC).
Method 1: Erase directly on the iPhone (iOS 15.2 or later)
Step-by-step instructions
This is the quickest approach — no PC or Mac required.
- Enter the wrong passcode at least 7 times in a row (if you're already at the "iPhone Unavailable" screen, you're already past this)
- Tap "Erase iPhone" in the lower-right corner
- Tap "Erase iPhone" again on the confirmation screen
- Enter your Apple ID password to sign out of iCloud
- Tap "Erase iPhone" one final time — the erase begins immediately
- When it completes, the initial setup screen appears
Requirements and caveats
This method only works when the iPhone is online. If Wi-Fi is unavailable and there's no cellular data, the Apple ID authentication step (step 4) will stall. In that case, move to a location with Wi-Fi or switch to the Mac/Windows method.
If you've also forgotten your Apple ID password, you'll need to reset it at iforgot.apple.com from another device before coming back to step 4.
Bottom line: If your iPhone runs iOS 15.2 or later, is online, and you know your Apple ID password, this is the fastest path forward.
Method 2: Erase via Mac (Finder)
On macOS Catalina (10.15) and later, iTunes was replaced by Finder for managing iOS devices. Use the following steps to erase via Recovery Mode.
- Fully shut down the iPhone (hold the side button + a volume button, then slide to power off)
- Connect the iPhone to your Mac with a USB-Lightning or USB-C cable
- Put the iPhone into Recovery Mode using the model-specific button sequence (see the section below)
- Open Finder — the iPhone appears in the sidebar
- When a dialog says "There is a problem with the iPhone that requires it to be updated or restored," click "Restore"
- Click "Restore and Update" on the confirmation sheet
- macOS downloads the latest iOS and erases the device automatically (allow 15–30 minutes total)
The iPhone restarts several times during this process. Do not disconnect the cable until you see the "Hello" setup screen. If Recovery Mode exits mid-process, shut the iPhone down and repeat the button sequence to re-enter it.
Method 3: Erase via Windows PC (iTunes or Apple Devices)
On Windows, use either iTunes or the newer Apple Devices app, both available from the Microsoft Store. Windows 11 recommends Apple Devices, but the workflow is identical.
- Make sure iTunes or Apple Devices is updated to the latest version before you start
- Fully shut down the iPhone
- Connect it to your Windows PC via USB
- Enter Recovery Mode using the model-specific button sequence
- iTunes or Apple Devices launches automatically and shows a dialog about the iPhone needing to be updated or restored
- Click "Restore", then "Restore and Update" on the next screen
- Wait for iOS to download and the erase to complete
If Windows doesn't recognise the iPhone, the Apple Mobile Device Support driver may be missing or outdated. Try reinstalling iTunes or Apple Devices, or check the driver status in Device Manager.
Cable tip: A low-quality cable can drop the connection mid-restore and cause the process to fail. Use an Apple-certified or MFi-certified data cable.
How to enter Recovery Mode (by model)
Recovery Mode is used in Methods 2 and 3. The button sequence varies by model. Perform these steps while the iPhone is connected to the PC or Mac via USB.
Face ID models
Applies to iPhone X and later (X, XS, XR, 11, 12, 13, 14, 15, 16 series).
- Press and quickly release the volume up button
- Press and quickly release the volume down button
- Press and hold the side button until the cable-and-computer icon appears (keep holding even through the Apple logo)
Home button models — iPhone 8 and SE
Applies to iPhone 8, 8 Plus, SE (2nd and 3rd generation).
- Press and quickly release the volume up button
- Press and quickly release the volume down button
- Press and hold the side button until the cable icon appears
iPhone 7 and 7 Plus
- Press and hold the side button and volume down button simultaneously
- Release both when the cable icon appears
For iPhone 6s and earlier, the original SE, and iPod touch, the combination involves the Home button and the top or side button. Check Apple's support pages for your exact model.
Recovery Mode exits before you're ready
If the Apple logo appears and the phone boots normally, you released the button too soon. The Apple logo appearing is not the signal to let go — keep holding until you see the cable-and-computer icon. If you miss it, shut the iPhone down and start the sequence from the beginning.
Restoring after the erase
Restore from an iCloud backup
During initial setup, when you reach the "Apps & Data" screen, choose "Restore from iCloud Backup."
- Sign in with your Apple ID
- Select the backup you want to restore (identified by date and size)
- Stay on Wi-Fi and wait for the download and restore to finish (10 minutes to several hours, depending on backup size)
- After the restore, apps re-download automatically in the background
Time varies widely based on backup size and connection speed. Plug into a charger and stay on a stable Wi-Fi network throughout.
Restore from a PC or Mac backup
If you backed up via iTunes, Finder, or Apple Devices, connect the iPhone to the same computer used for the erase and choose "Restore from This Backup." If the backup is encrypted, you'll need the backup password. Encrypted backups include saved passwords, Health data, Wi-Fi settings, and call history — more complete than an unencrypted backup.
No backup available
If there's no backup to restore, choose "Set Up as New iPhone." Signing in with your Apple ID will pull back anything that was synced to iCloud — contacts, calendars, notes, some photos, iCloud Keychain passwords, and so on. Data stored only inside individual apps (LINE chat history, game saves, etc.) cannot be recovered. You'll need to use each app's own transfer or backup feature to handle those on a case-by-case basis.
How to avoid this in the future
Use Face ID or Touch ID alongside your passcode
Face ID and Touch ID are supplements to your passcode, not replacements. If you rely on biometrics every day, the passcode can become unfamiliar quickly. The iPhone requires passcode entry immediately after a restart, an iOS update, or 48 hours of inactivity — so make sure your passcode is something you can type confidently in those moments.
Passcodes are not stored anywhere
iCloud Keychain stores website and app passwords, but the iPhone's device passcode is never saved anywhere — not in iCloud, not with Apple Support. If you forget it, there's no recovery mechanism. The practical solution is to write it down somewhere secure: the secure notes section of a password manager, or a trusted family safe.
Set up automatic iCloud backups
The more recent your backup is, the less you lose when an erase becomes necessary. Go to Settings → your name → iCloud → iCloud Backup and turn it on. With this enabled, your iPhone backs up automatically every night while it's plugged in and on Wi-Fi. If you're running low on the free 5 GB, the 50 GB plan (¥130/month) is enough for most people.
Frequently asked questions
Is there any way to remove just the passcode?
Not through any legitimate means. Paid apps and websites that claim to "unlock" or "bypass" an iPhone passcode almost always just put the device into Recovery Mode and erase it — the same thing you can do for free. Some of these services also attempt to steal your Apple ID credentials in the process. Never enter your Apple ID password into any third-party unlocking tool.
Work or school iPhones require extra caution
A company- or school-issued iPhone may be enrolled in MDM (Mobile Device Management). MDM-managed devices can be prevented from erasing without administrator approval, or they may re-enroll into management automatically after an erase. Contact your IT administrator before attempting any recovery steps on a managed device.
What happens to Find My when I erase?
When you erase an iPhone through Recovery Mode, Activation Lock remains in place — the setup screen will ask for the original Apple ID and password. This is intentional and is how theft protection works. If it's your own Apple ID, you simply sign in and continue. If you bought a used iPhone and this screen appears, the previous owner's Apple ID is still linked — contact them to remove it remotely via iCloud.com, or return the device.
Summary
Here's a quick recap of everything covered in this guide.
- Passcode-only removal is not possible. An erase is always required.
- On iOS 15.2 or later with an online iPhone, the on-device "Erase iPhone" option is the fastest route.
- Otherwise, use Mac (Finder) or Windows (iTunes / Apple Devices) with Recovery Mode.
- The button sequence for Recovery Mode differs by model — confirm yours before connecting.
- After the erase, restore from an iCloud or PC/Mac backup. Without a backup, iCloud-synced data comes back automatically, but app-only data does not.
- Prevent future lockouts by noting down your passcode and enabling automatic iCloud backups.
The process takes time and care, but following Apple's official steps will always get you to the setup screen. Don't be tempted by third-party tools — the official route is the only one that actually works.
For a broader look at iPhone problems, see iPhone Troubleshooting Guide | Fixes Organized by Symptom. If you've forgotten a Windows password instead, see How to Reset a Forgotten Windows Password | Microsoft Account, Local Account, and PIN.


