You can erase an iPhone without knowing its passcode, either with the Forgot Passcode? option Apple shows on the Lock Screen after repeated wrong attempts or with a Mac or Windows PC in recovery mode, but you still need your Apple Account password, either before the erase or afterward, if Find My was on, because of Activation Lock. Erasing deletes everything on the phone, and a recent iCloud or computer backup is the only way to get your data back.
First, check whether you need to erase at all
Two situations look like a forgotten passcode but have a gentler fix.
You changed the passcode in the last 72 hours. On iOS 17 and later, Passcode Reset lets you use your previous passcode for 72 hours after a change, without a computer and without erasing anything. Apple recommends trying it first:
- Enter the wrong passcode until the iPhone Unavailable screen appears (this happens after five incorrect attempts).
- Tap Forgot Passcode? in the bottom corner of the screen.
- Tap Enter Previous Passcode, type your old passcode, then follow the prompts to set a new one right away.
The Forgot Passcode? button only shows when the iPhone is connected to Wi-Fi or cellular, signed in to your Apple Account, and has Find My turned on. If you didn’t change the passcode recently, Enter Previous Passcode won’t help, and the same button leads to the erase option described below.
The code you forgot is for Screen Time, not the phone. If you can open the iPhone but it asks for a code when you try to change restrictions or app limits, that’s the Screen Time passcode. It is separate from the device passcode, and erasing the phone is the wrong tool; follow the steps for resetting a forgotten Screen Time passcode instead.
What you need, and what you will lose
Read this before you start, because every method from here on is permanent.
- All data on the iPhone is deleted. Photos, messages, apps and settings that exist only on the phone are gone once the erase starts. There is no undo.
- A backup is the only way back. If you made an iCloud backup or a backup on a computer before you got locked out, you can restore it during setup. Don’t count on making a new backup now: a computer normally asks the iPhone for its passcode, or to tap Trust, before it can work with the phone.
- Your Apple Account password. The Lock Screen method asks for it before erasing. After a recovery mode or iCloud.com erase, if Find My was on, the phone asks for it during setup to clear Activation Lock. If you’ve forgotten it, start the password reset now (covered later), since it can take days.
- eSIM. On iOS 17 and later, the Lock Screen method lets you keep your eSIM or delete it while erasing. On iOS 16 or earlier, Apple says to contact your carrier first and ask for a QR code so you can set up the eSIM again.
- Ownership. Only erase a phone that’s yours. If you bought it used and it’s locked to someone else’s account, erasing won’t make it usable; skip to the second-hand phone section.
Pick the method that fits your situation
| Method | What it needs | Best when |
|---|---|---|
| Forgot Passcode? on the Lock Screen | iOS 15.2 or later, Find My already on, Wi-Fi or cellular, Apple Account password | You have the phone and no computer |
| Recovery mode with a computer | Mac or Windows PC, a cable that charges the phone, internet, up to 60 minutes | Forgot Passcode? doesn’t appear, Find My was off, or the phone won’t connect to a network |
| Erase This Device on iCloud.com or in Find My | Find My already on, your Apple Account sign-in | The phone is out of reach, or you’re on another device |
Apple’s own order is: Passcode Reset, then the on-device reset, then the computer. Example: Priya’s iPhone runs iOS 27, Find My is on and it’s on her home Wi-Fi, so she can use the Lock Screen option. Jordan’s older phone has Find My turned off, so recovery mode on a laptop is his only route.
Erase the iPhone from the Lock Screen
These steps match iOS 17 and later, including iOS 27. The phone must already have Find My turned on, and it must be connected to Wi-Fi or cellular.
- On the Lock Screen, keep entering a passcode until the iPhone Unavailable screen appears.
- When it becomes available, tap Forgot Passcode? in the bottom corner.
- On the Security Lockout screen, tap Start iPhone Reset.
- Enter your Apple Account password. This signs the iPhone out of your account.
- Tap Erase iPhone. If you use an eSIM, choose whether to keep it or delete it as part of the erase.
- Wait for the iPhone to restart, then follow the setup prompts: restore from a backup if you have one, and set a new passcode.
On iOS 15.2 and iOS 16, the screen shows an Erase iPhone option instead of Forgot Passcode?, under the same conditions (network connection, signed in, Find My on). If neither option appears, the phone is missing one of those conditions, so use a computer.
Restore the iPhone with a computer in recovery mode
Recovery mode works even when Find My was off or the phone can’t reach a network. You need a Mac or Windows PC, a cable that can charge the iPhone, an internet connection and up to an hour. On a Mac, Apple’s steps use Finder. On a Windows PC (Windows 10 or later), they use the Apple Devices app from the Microsoft Store; Apple’s current steps use the Apple Devices app rather than iTunes, so follow those if your PC can run it. If you don’t have a computer and can’t borrow one, Apple says to visit an Apple Store or an Apple Authorized Service Provider.
Turn the iPhone off
- iPhone with Face ID: press and hold the side button and the Volume down button until the power off slider appears, then drag the slider.
- iPhone with a Home button: press and hold the top or side button until the slider appears, then drag it.
Start recovery mode
For every model, connect the cable to the computer first. Then plug the cable into the iPhone while immediately holding the button listed below, and keep holding it through the Apple logo until you see an image of a computer and a cable.
- iPhone with Face ID, iPhone 8, iPhone 8 Plus and iPhone SE (2nd and 3rd generation): the side button.
- iPhone 7 and iPhone 7 Plus: the Volume down button.
- iPhone 6s and earlier, and iPhone SE (1st generation): the Home button.
If the buttons don’t respond and you can’t reach the computer-and-cable screen, the phone may need service from Apple. Because recovery mode is driven by the buttons and the computer, you don’t have to type anything on the iPhone’s screen.
Restore from Finder or Apple Devices
On a Mac:
- Open a Finder window and select your iPhone in the sidebar under Locations.
- If asked, allow the accessory to connect.
- When you’re offered Restore or Update, choose Restore.
On a Windows PC:
- Open the Apple Devices app and select your iPhone in the sidebar.
- Select Trust if asked, then select General.
- Select Restore and follow the onscreen instructions.
The computer may need to download iOS before it can finish, and that download can take more than 15 minutes. If the iPhone leaves the recovery mode screen or restarts during the download, let the download finish, turn the iPhone off and start recovery mode again. Keep the cable connected until the iPhone shows the Hello screen, then disconnect it and set the phone up.
Apple’s full instructions, with model-by-model illustrations, are on its page about using a computer to reset your iPhone and passcode.
Erase it remotely with iCloud.com or Find My
If Find My was turned on, you can erase the phone from any web browser or from another Apple device signed in to the same Apple Account. This also suits a phone that’s lost or out of reach, and the full no-computer walkthrough is in factory resetting an iPhone without a password or computer.
- Go to icloud.com/find and sign in with the Apple Account used on the locked iPhone.
- In the list of devices, select the iPhone.
- Select Erase This Device and follow the onscreen instructions. If you’re asked for a phone number or message, it appears on the iPhone’s Lock Screen, which is useful for a lost phone and optional for one in your hand.
If the iPhone is online, the erase begins right away; if it’s offline, it begins the next time the phone connects. Apple sends a confirmation email to your Apple Account address. While the erase is still pending, you can cancel it by selecting the device and choosing Stop Erase Request.
After the erase: Activation Lock and your Apple Account
Activation Lock turns on automatically with Find My, and it stays on after a recovery mode restore or an iCloud.com erase (the Lock Screen method signs you out first). When the phone restarts, setup asks for the Apple Account and password used on the phone (or, in some cases, the old device passcode). That’s by design: Apple built it so a lost or stolen iPhone can’t be wiped and reused by someone else.
If you forgot your Apple Account password, use Apple’s own process:
- On the setup screen, choose Forgot password? and follow the prompts. Apple may send you to a trusted device (another iPhone, iPad, Mac, Apple Watch or Apple Vision Pro already signed in) or ask for recovery factors such as a code sent to your trusted phone number.
- If you have a trusted device, change the password there; it’s the fastest route.
- If you can’t reset it, request account recovery: go to iforgot.apple.com in Safari on a device with iOS 17 or later or macOS 27 or later, or open the Apple Support app on a borrowed device and choose Support Tools, Reset Password, then Help Someone Else.
Account recovery can take several days or more. If you start it on the web, turn off your other Apple devices during the wait, because activity from a signed-in device cancels the request. If you’ve forgotten the account name itself, try the email addresses and phone numbers you normally use with Apple.
If you still can’t get past Activation Lock and you have proof of purchase, Apple offers an Activation Lock support request, linked from its page on how to remove Activation Lock. A phone owned by a business or school has to be released by that organization’s IT department.
If you bought the iPhone second-hand
On iOS 15 and later, a phone still protected by Activation Lock shows an “iPhone Locked to Owner” screen. Erasing it yourself won’t change that. Ask the seller to enter their password, or to remove the device from their account in a browser: at icloud.com/find they select the iPhone and choose Remove This Device. Apple’s advice is not to take ownership of a used iPhone until you see the Hello screen with no request for the previous owner’s account.
Restore your data and confirm it worked
The reset worked when the iPhone shows the Hello screen and lets you through setup with a passcode you choose. From there:
- From iCloud: continue setup until Transfer Your Apps & Data, tap From iCloud Backup, sign in, and pick the most recent backup. Keep the phone on Wi-Fi and power; photos and apps keep downloading after setup. The steps for restoring an iPhone from an iCloud backup cover what to expect.
- From a computer: connect the phone, select it in Finder or Apple Devices, click Restore Backup, choose the latest backup, and enter the backup password if it was encrypted.
- No backup: set the iPhone up as new. Anything that lived only on the phone can’t be recovered.
Activation Lock, backups and other questions
Can Apple unlock the iPhone without erasing it?
No. Apple’s instructions say that to get into an iPhone after forgetting the passcode, you must reset it, and that this erases the data on it.
Does erasing remove my Apple Account from the phone?
Only the Lock Screen method signs you out, because you enter your password before the erase. After a recovery mode restore or an iCloud.com erase, Activation Lock stays on and the phone still asks for your account.
How long does it take?
Apple budgets up to 60 minutes for the computer method. Most of that is the iOS download, which can run past 15 minutes on a slow connection. Restoring a backup adds more time, depending on its size and your network.
Can I avoid updating iOS during the restore?
Not reliably. Apple notes that the iPhone might need an update before the restore can finish, so the computer installs current software.
Once you’re back in, pick a passcode you’ll remember and make sure iCloud Backup is on. The next time you wipe a phone you can open, use the regular factory reset from Settings instead.