Forgot your iPhone passcode? The Forgot Passcode? option on the Lock Screen is worth a look before you reach for a computer. If it appears, you can erase the iPhone right there.
Erasing is normally required to remove a forgotten passcode. There’s no supported way to keep data stored only on the iPhone while removing the passcode. Before you erase it, check that you know your Apple Account password and have a backup you can restore. If you changed the passcode recently, check for a previous passcode option first: on iOS 17 or later, Apple lets you use your old passcode for 72 hours after a change.
Reset your iPhone from the Lock Screen
This works when Forgot Passcode? appears on an iPhone Unavailable or Security Lockout screen. Your iPhone needs a Wi-Fi or cellular connection, Find My must be enabled, and you’ll need the password for the Apple Account signed in on it. Apple explains the requirements and reset process.
- On the Lock Screen, follow the prompts until iPhone Unavailable or Security Lockout appears. Tap Forgot Passcode?. If you’re offered a way to use your previous passcode and you remember it, take that option before erasing.
- Choose the option to start an iPhone reset. The wording can vary by iOS version.
- Enter your Apple Account password, then confirm Erase iPhone. The iPhone deletes its data and restarts.
- Follow setup, create a new passcode, and restore a backup if you have one.
This on-device route doesn’t need a Mac or Windows computer, which helps in a frustrating moment. If you’re keeping the same cellular plan, choose to keep your eSIM when the erase flow offers that choice. Deleting it can mean contacting your carrier to activate the plan again.
Use recovery mode with a Mac or Windows computer
Use recovery mode if Forgot Passcode? doesn’t appear, the iPhone is offline, or the Lock Screen reset fails. You’ll need an internet connection, a cable that can charge your iPhone (such as a USB-C charging cable or Lightning cable), and a Mac or Windows computer. A USB-C adapter can help if your cable doesn’t fit the computer’s port.
Recovery mode erases the iPhone and reinstalls iOS. You don’t need to have synced the iPhone with that computer before. Apple’s passcode recovery instructions cover the computer-based process.
Put the iPhone in recovery mode
Turn off the iPhone and connect the cable to your computer. Then use the button for your model as you connect the cable to the iPhone:
- iPhone with Face ID, iPhone 8 or later, or iPhone SE (2nd generation or later): Hold the side button.
- iPhone 7 or iPhone 7 Plus: Hold Volume Down.
- iPhone 6s, iPhone SE (1st generation), or earlier: Hold the Home button.
Keep holding the button through the Apple logo. Release it when the computer-and-cable recovery screen appears.
Restore with Finder on a Mac
On macOS Catalina 10.15 or later, Finder handles iPhone restores.
- Open Finder and select your iPhone under Locations in the sidebar.
- When Finder offers Update or Restore, choose Restore and confirm. Update attempts to reinstall iOS without erasing it, so it won’t remove a forgotten passcode.
- Wait for the download and restore to finish. Then complete setup on the iPhone.
Restore with Apple Devices on Windows
Use the Apple Devices app on Windows.
- Open Apple Devices and select the iPhone in its sidebar. If you’re asked to trust the device, choose Trust.
- Open General, choose Restore, and follow the prompts. If the app shows a recovery prompt with Update and Restore, choose Restore.
- Wait for the iPhone to restart, then complete setup.
If the software download takes long enough for the iPhone to leave recovery mode, let the download finish. Put the iPhone back into recovery mode and choose Restore again. If the computer doesn’t detect it, try a different cable or USB port, connect directly instead of through a hub, and update macOS or Apple Devices.
Erase the iPhone with Find My
Find My offers another route if it was enabled on the locked iPhone and you can sign in to its Apple Account. The erase runs when the iPhone is online; if it’s offline, the request waits until it reconnects.
- Open the Find My app on another Apple device, or sign in to iCloud in a browser and open Find Devices.
- Select the locked iPhone from the device list.
- Choose the device’s erase action. Its label and placement can vary between the app and website.
- Confirm the erase, then set up the iPhone and restore a backup if one is available.
Restore your data and get through Activation Lock
An erase removes the passcode, apps, settings, Apple Pay cards, and data stored only on the iPhone. During setup, choose an iCloud backup or a Mac or Windows computer backup if you have one. Data already synced through iCloud, such as contacts or photos, can return when you sign in and enable the relevant service.
If you’re restoring a computer backup on a Mac, select the iPhone in Finder and choose Restore Backup.
Pick the backup you want and follow Finder’s prompts.
Activation Lock can still ask for the Apple Account previously linked to the iPhone after an erase. Erasing doesn’t remove that link. If you’ve forgotten the account password, recover it through Apple before relying on any of these erase methods to get the phone usable again. For a work or school iPhone, contact the organization’s device administrator if setup is restricted.
If Forgot Passcode? appears, I’d recommend starting there. It’s the quickest recovery option when you have your Apple Account password and a backup ready; recovery mode remains the dependable fallback when the Lock Screen gives you no way forward.