How to Recover Your iPhone Passcode
In this article
Yes, you can recover a forgotten iPhone passcode by erasing the device and restoring it from a backup, which removes the lock without needing the original code.
What You'll Need
- A Mac or Windows PC with the latest version of Finder (macOS Catalina or later) or iTunes (Windows or macOS Mojave and earlier).
- A Lightning to USB cable that works with your iPhone.
- Your Apple ID and password (required to reactivate the device after restore).
- A recent iCloud or iTunes/Finder backup, if you want to keep your data.
- Patience – the process can take 10‑20 minutes depending on the model and amount of data.
Step-by-Step
- Confirm you have a backup. Open Settings on another iOS device signed into the same Apple ID, tap your name → iCloud → iCloud Backup, and check the date of the last backup. If you use iTunes/Finder, connect a previously synced computer and look under the device summary for the latest backup timestamp.
- Turn off Find My iPhone (if possible). If you can still access the device, go to Settings → your name → Find My → Find My iPhone and toggle it off. If the device is locked, skip this step; the restore will still work but you will need your Apple ID credentials later.
- Put the iPhone into Recovery Mode. The exact button combination depends on the model:
- iPhone 8, X, 11, 12, 13, 14 series: Press and quickly release Volume Up, then Volume Down, then hold the Side button until the recovery‑mode screen appears.
- iPhone 7 / 7 Plus: Hold Volume Down and the Side button together until the recovery screen shows.
- iPhone 6s and earlier: Hold Home and the Top (or Side) button together until the recovery screen appears.
- Connect the iPhone to your computer. Use the Lightning cable and open Finder (macOS Catalina or later) or iTunes (Windows/macOS Mojave). The device should appear with a message that says "iPhone is in recovery mode" and offers two options: Restore or Update.
- Select "Restore". This downloads the latest iOS firmware, wipes the iPhone, and installs a fresh copy of iOS. Do not choose "Update" because it attempts to keep data and will fail if the passcode is unknown.
- Wait for the restore to finish. The computer will show a progress bar. The iPhone will restart several times. When the process completes, you will see the "Hello" setup screen.
- Set up the iPhone. Follow the on‑screen prompts. When asked, sign in with your Apple ID. If you turned on Activation Lock, the device will verify the Apple ID before allowing use.
- Restore your data. During setup, you can choose to restore from an iCloud backup, an iTunes/Finder backup, or set up as a new device. Pick the most recent backup to recover apps, photos, messages, and settings.
- Create a new passcode. After the device is unlocked, go to Settings → Face ID & Passcode (or Touch ID & Passcode) and set a new six‑digit or alphanumeric code that you can remember. Consider enabling Face ID or Touch ID for quicker access.
- Verify everything works. Open a few apps, check that contacts and photos appear, and ensure iMessage and FaceTime are functional. If any data is missing, repeat the restore step using a different backup if you have one.
Common Mistakes
- Trying to "Update" instead of "Restore" – Update keeps the existing data and will not remove the passcode.
- Using an outdated version of iTunes/Finder – older software may not recognize newer iPhone models, causing the restore to fail.
- Skipping the backup check – restoring without a recent backup can lead to permanent loss of photos, messages, and app data.
- Disconnecting the cable during the restore – this corrupts the firmware install and may leave the device stuck in recovery mode.
- Entering the wrong Apple ID after the restore – Activation Lock will refuse to activate the phone, leaving you unable to use it.
Tips
- Keep your computer plugged into power during the restore to avoid interruptions.
- If the download of iOS firmware stalls, try a different Wi‑Fi network or use a wired Ethernet connection.
- Enable "Find My iPhone" after the restore to protect against theft and to use iCloud's remote erase feature if needed.
- Write your new passcode down in a secure place or store it in a password manager to avoid future lockouts.
- For models with Face ID, consider using a simple alphanumeric passcode plus biometric authentication; this reduces the chance of forgetting the code.
Troubleshooting
If the device does not exit recovery mode or shows an error code, follow these steps in order:
- Restart both devices. Disconnect the iPhone, power off your computer, then power them back on and try the restore again.
- Update iTunes/Finder. On Windows, open iTunes > Help > Check for Updates. On macOS, use Software Update to get the latest Finder support.
- Try a different USB port or cable. Faulty hardware can prevent proper communication between the iPhone and computer.
- Use DFU mode if recovery mode fails. DFU (Device Firmware Update) mode bypasses the bootloader and forces a low‑level restore:
- Connect the iPhone to the computer.
- For iPhone 8 and later: Quickly press Volume Up, then Volume Down, then hold the Side button for 5 seconds. While still holding the Side button, press and hold Volume Down for another 5 seconds, then release the Side button but keep holding Volume Down for 10 seconds. The screen stays black, indicating DFU mode.
- For iPhone 7/7 Plus: Hold Side and Volume Down together for 10 seconds, then release the Side button while continuing to hold Volume Down for another 10 seconds.
- For iPhone 6s and earlier: Hold Home and Side button for 10 seconds, then release Side button while continuing to hold Home for another 10 seconds.
- Check Apple’s System Status page. Rarely, Apple’s activation servers experience outages that prevent a device from completing setup after a restore.
- Contact Apple Support. If you encounter persistent error codes (e.g., 4013, 4014) or the device does not stay in DFU mode, professional hardware diagnostics may be required.
Frequently Asked Questions
Can I recover my iPhone passcode without erasing the device?
No. Apple’s security model requires a full erase to remove an unknown passcode. The only alternative is to remember the code.
Will restoring erase all my data?
Yes, the restore process wipes the device. However, you can recover most data by restoring from an iCloud or iTunes/Finder backup made before the lock.
Do I need my Apple ID password to reactivate the iPhone?
Yes. After the erase, Activation Lock asks for the Apple ID and password that were originally used on the device.
What if I never backed up my iPhone?
You will still be able to use the phone after a restore, but any data that was not synced to iCloud (photos, messages, app data) will be lost permanently.
Is DFU mode different from Recovery mode?
DFU mode bypasses the iPhone’s operating system and boots it into a state where only iTunes/Finder can communicate, making it useful when Recovery mode fails.
Can I change the passcode without a computer?
No. Without the current passcode, the only way to change it is to erase the device, which requires a computer running Finder or iTunes.