Forgot your iPhone passcode and can't get past the lock screen? You can erase it from the lock screen, through Find Devices, or with a computer. Erasing deletes your local data, so check the previous-passcode option first to see whether you can get back in without losing anything.
Try your previous passcode before erasing
On iOS 17 or later, this restores access without deleting data within 72 hours of a passcode change, unless you've already expired the previous code. Forgot Passcode? appears only if the iPhone is connected to Wi-Fi or cellular, signed in to your Apple Account, and has Find My turned on.
- 1.After five incorrect passcode attempts, tap Forgot Passcode?.
- 2.Tap Enter Previous Passcode (Apple's screenshot shows this button as Try Passcode Reset).
- 3.Enter your previous passcode and follow the instructions to create a new one.
Erase directly from the locked iPhone
This method works on iOS 17 or later with Find My enabled before you lost access and an active Wi-Fi or cellular connection. You'll also need the associated Apple Account password.
Enter incorrect passcodes until iPhone Unavailable appears, then tap Forgot Passcode?. Next, tap Start iPhone Reset and enter your Apple Account password.
Tap Erase iPhone. If an eSIM choice appears, choose whether to keep or delete it. Wait for the phone to erase and restart before completing setup.
On iOS 15.2–16, the lock screen shows Erase iPhone instead, with the same requirements; tap it and follow the prompts to erase. iOS 17 and later use Forgot Passcode?.
A browser can erase the phone remotely
If Find My was already enabled, you can erase your iPhone from a browser on a computer, another phone, or a tablet. Borrowed and non-Apple devices work too.
Visit iCloud Find Devices and sign in to your Apple Account. If you can't receive a verification code, select Find Devices at the bottom of the authentication window.
Select your iPhone from the device list. Choose Erase This Device and follow the confirmation prompts. If the phone is offline, the erase starts when it next comes online.
Find My erasure keeps Activation Lock in place. You'll still need the associated Apple Account credentials to activate the phone afterward.
Put your iPhone into recovery mode
Get a suitable cable and a computer with internet access. Use the following power-off procedure for an iPhone with Face ID, iPhone 8 or 8 Plus, or iPhone SE second or third generation.
Power off your iPhone, then connect the cable to the computer. Connect the cable to your iPhone while immediately holding the side button, and keep holding past the Apple logo until the computer-and-cable image appears.
For an iPhone 8 or later that's already connected, use this alternative sequence instead: quickly press and release the Volume Up button. Then quickly press and release the Volume Down button. Hold the side button until the Connect to computer screen appears.
That Connect to computer screen is recovery mode. If the iPhone just restarts normally instead, nothing has been erased, so repeat the sequence.
Restore through your computer
A normal computer connection can ask for the forgotten passcode or permission to trust the computer, blocking the restore. Put your iPhone in recovery mode using the procedure above.
On a Mac running macOS Catalina 10.15 or later, open Finder. Select your iPhone under Locations, then allow the accessory connection if prompted. Choose Restore when offered Restore or Update.
On Windows, open Apple Devices and select your iPhone in the sidebar. Select Trust if prompted, then open General. Select Restore and follow the confirmation prompts.
If your Windows installation uses iTunes instead, open it, then select the recovery-mode iPhone. Choose Restore when prompted.
If the software download outlasts recovery mode, let the download finish. Put the iPhone back into recovery mode, then continue the restore.
Computer restoration preserves the eSIM and installs compatible system software. There's no need to download firmware separately.
If you can't borrow a computer or the recovery-mode buttons need service, visit an Apple Store or Apple Authorized Service Provider for help performing the reset.
Set up your iPhone again
Once your iPhone finishes erasing and restarts, it's ready for setup.
- 1.Follow the setup prompts, entering the associated Apple Account credentials when required for activation.
- 2.Restore an available backup to recover backed-up data.
- 3.Create a new passcode as part of setup.
Frequently Asked Questions
Can I erase my iPhone using Face ID if I forgot the passcode?
Face ID alone isn't enough. Apple's Settings erase procedure still requires the device passcode.
Will ten wrong passcode attempts automatically erase my iPhone?
Only if Erase Data was enabled before you lost access. Ten consecutive qualifying incorrect attempts trigger erasure; repeated attempts with the same incorrect code do not count toward the limit. You cannot enable this setting from the locked screen.
Can my work or school administrator erase the locked iPhone?
Yes, if the iPhone is already enrolled in device management that supports whole-device erasure. Ask the administrator to send an erase command; the phone must receive it to erase. User Enrollment does not support whole-device erasure, and removing company apps or work data does not factory reset the phone.