Identify which password you forgot
This page addresses the iPhone device passcode used at the Lock Screen. An Apple Account password and an encrypted computer-backup password have separate recovery processes. Repeated guesses at the device passcode can lengthen a lockout. Check whether you recently changed the passcode and still know the previous one.
If Face ID or Touch ID still lets you use the phone, verify the date and availability of an existing iCloud or computer backup. Do not assume you can make a new complete backup after the phone is already locked.
Swipe the table sideways to see every column →
| Your situation | First path | Current data |
|---|---|---|
| Changed the passcode within 72 hours and know the previous one | Forgot Passcode? → Enter Previous Passcode | Can be preserved if successful |
| Previous passcode unavailable; reset appears on the Lock Screen | Check network, Find My, and Apple Account access | On-device reset erases data |
| No usable on-device reset | Follow Apple's model-specific computer recovery | Computer restore erases data |
| Forgot the Apple Account password instead | Use Apple Account recovery | A different credential |
Recently changed it? Check the 72-hour previous-passcode route
On iOS 17 or later, Apple's Passcode Reset temporarily accepts the previous device passcode for 72 hours after a change. If that period expired, you forgot the old code, or deliberately expired it early, this route is unavailable.
When the Lock Screen shows iPhone Unavailable, tap Forgot Passcode? and choose Enter Previous Passcode. Enter the old code and set a new one as prompted. Apple says the option needs an active cellular or Wi-Fi connection, a signed-in Apple Account, and Find My enabled. This is separate from Start iPhone Reset; stop and check your backup before agreeing to erase data.
If that route fails, assess what an erase would remove
Both on-device reset and computer recovery erase data and settings currently on the iPhone. An existing iCloud or computer backup can restore its contents at setup, but newer items created after that backup might be absent. Check backup dates, synced photos, and essential app data from another device or computer you can still access.
Know the password for the Apple Account associated with this iPhone. Activation Lock may ask for that account after restoration. Erasing the phone does not transfer ownership or remove another person's account association. Avoid services promising to unlock a passcode without data loss.
Use on-device reset when the requirements are met
Apple's on-device route requires iOS 15.2 or later, Find My already enabled, an active cellular or Wi-Fi connection, and access to the signed-in Apple Account password. On iOS 17 or later the Lock Screen can show Forgot Passcode?; iOS 15.2 or iOS 16 can show Erase iPhone. Follow the wording actually shown on your device.
After ruling out the previous-passcode option, read Start iPhone Reset and Erase iPhone carefully. On iOS 17 or later, Apple offers a choice to keep or delete an eSIM during the erase. If you use an eSIM on iOS 16 or earlier, Apple advises contacting your carrier before reset for a way to set it up again. After erasure, sign in with the linked Apple Account and restore from an available backup.
No on-device option? Follow computer recovery for your model
If the phone lacks the required connection or reset option, Apple's recovery-mode route uses a Mac or Windows PC, a cable, and internet. Use Finder on Mac or Apple Devices on Windows. The button sequence for entering recovery mode varies by iPhone model; open Apple's source below and select your exact model rather than following a generic sequence.
When the computer offers Update or Restore in the forgotten-passcode workflow, Apple directs you to Restore, which erases current data. A long download may let the phone leave recovery mode; finish the download and re-enter it as Apple describes. If the buttons fail or no computer is available, ask Apple or an authorized provider for help.
After recovery, verify the account, backup, and cellular line
At the Hello screen, activate with the original Apple Account, then choose an existing backup with a suitable date. Check photos, messages, essential apps, and access to two-factor codes. Re-downloading separately synced iCloud items does not prove that an entire device backup was restored.
Test calls, texts, and cellular data on your SIM or eSIM. If you deleted the eSIM during reset, ask the carrier to reprovision it; if No Service persists, follow the separate cellular guide. Set a new device passcode and keep account recovery and backup information somewhere safe outside this phone.