You can regain access through your Apple ID, a trusted device, or recovery mode — the fastest route depends on what you have available right now
If you've forgotten your iPhone password, you have three main paths back in: using your Apple ID on the lock screen, signing in from a trusted device, or connecting to a computer and using recovery mode. Which one works fastest depends on whether you remember your Apple ID password, whether you have another Apple device nearby, and how much time you have. None of these routes will erase your data if you use the Apple ID method — but recovery mode will.
The lock screen itself offers the quickest entry point if you remember your Apple ID email and password. After you enter your passcode wrong several times, your iPhone will show "iPhone Unavailable" and offer you the option to use your Apple ID instead. Tap that option, enter your Apple ID credentials, and you can set a new passcode without losing anything on the phone.
Key Takeaways
- If you remember your Apple ID password, you can unlock your iPhone directly from the lock screen after several failed passcode attempts, without erasing any data.
- A trusted device (Mac, iPad, or another iPhone) signed into the same Apple ID can let you reset your passcode through Settings without a computer.
- If you have neither your Apple ID password nor a trusted device, you will need to connect your iPhone to a Mac or Windows computer and use recovery mode, which erases the phone.
- Recovery mode takes 30 minutes to an hour and requires a computer with macOS Monterey or later (Mac) or iTunes or newer (Windows).
- Two-factor authentication on your Apple ID makes recovery slower because Apple sends verification codes to your trusted devices, but it also makes your account harder to break into.
Using your Apple ID from the lock screen
This is the fastest method if you remember your Apple ID email and password. On your iPhone, enter your passcode incorrectly six times. After the sixth attempt, your screen will show "iPhone Unavailable" and a message saying "Try again in 5 minutes." Wait for the timer, then try again. After several more failed attempts over a few minutes, you'll see an option that says "iPhone Unavailable — Use your Apple ID to unlock this iPhone" or similar wording depending on your iOS version.
Tap that option. Enter your Apple ID email address and password. If your Apple ID has two-factor authentication turned on, Apple will send a verification code to one of your trusted devices — usually your Mac, iPad, or another iPhone. Check that device, enter the code on your locked iPhone, and then create a new passcode. Your data stays on the phone. This entire process takes about 10 minutes.
If you don't see the Apple ID unlock option after multiple failed attempts, your iPhone may have a different security setting or an older iOS version. Move to the trusted device method instead.
Resetting your passcode from a trusted device
A trusted device is any Mac, iPad, or iPhone that's signed into the same Apple ID as your locked phone and has two-factor authentication enabled. If you have one nearby, you can use it to reset your passcode without touching your locked iPhone.
On your trusted device, open Settings (or System Settings on Mac), tap your name at the top, then tap "Password & Security" or "Security." Look for an option called "Change Passcode" or "Reset Passcode." Select your locked iPhone from the list of devices, then follow the prompts to create a new passcode. Apple will send a verification code to your trusted device to confirm it's really you. Enter that code, set your new passcode, and you're done. Your data is safe.
This method works even if you've forgotten your Apple ID password, as long as you're signed into your trusted device. It typically takes 5 to 10 minutes. If you don't have a trusted device, or if you're not signed into one with the same Apple ID, you'll need to use recovery mode.
Using recovery mode on a computer
Recovery mode is your last resort if you don't remember your Apple ID password and don't have a trusted device. It erases your iPhone completely and reinstalls iOS, so you should only use it if the other methods are truly unavailable. You'll need a Mac or Windows computer with a USB cable that fits your iPhone.
On Mac: Connect your iPhone with a USB cable. Open Finder and click your iPhone's name in the sidebar. Click "General," then look for a button that says "Restore iPhone" or "Restore." Click it. Your Mac will read the latest iOS version — this can take 10 to 30 minutes depending on your internet speed — and then erase and reinstall the operating system on your phone. When it's done, you'll see the setup screen, and you can sign back in with your Apple ID.
On Windows: Connect your iPhone with a USB cable. Open iTunes (or the newer "Devices" app if you're on Windows 11). Click the iPhone icon, then click "Restore." Windows will read iOS and erase your phone. The whole process takes 30 minutes to an hour. When it finishes, set up your iPhone again and sign in with your Apple ID to restore your data from iCloud backup — if you had backups turned on before you forgot your passcode.
After recovery mode finishes, your iPhone is blank. When you sign back in with your Apple ID, iCloud will offer to restore your photos, messages, apps, and settings from your most recent backup — but only if you had iCloud backup turned on before you locked yourself out. If you didn't, your data is gone.
What happens if you have two-factor authentication
Two-factor authentication makes recovery slower but safer. When you try to unlock your iPhone using your Apple ID, Apple sends a six-digit code to one of your trusted devices. You have to enter that code on your locked iPhone before you can set a new passcode. This adds 5 to 10 minutes to the process because you have to walk to another device and back.
If you don't have access to any trusted device, you can ask Apple to send the code to a phone number associated with your account instead. This takes longer — sometimes 24 hours — but it works if you're completely locked out. Call Apple Support at 1-800-MY-APPLE and explain that you need a recovery code sent to your phone number. They'll verify your identity by asking security questions, then send the code.
Two-factor authentication is worth the extra steps because it prevents someone else from resetting your passcode even if they know your Apple ID password. Without it, anyone with your email and password can unlock your phone.
Preventing this from happening again
Write your passcode down and store it somewhere safe — a physical notebook in a drawer, a password manager like 1Password or Bitwarden, or even a note in your partner's phone. You don't need to memorize it if you have it written down somewhere you can actually reach it.
Turn on iCloud backup so that if you ever do have to erase your phone, your photos, messages, and app data come back automatically. Open Settings, tap your name, tap "iCloud," then tap "iCloud Backup" and turn it on. Your phone will back up every night when it's plugged in and on Wi-Fi.
Make sure you know your Apple ID password, or store it in a password manager. You'll need it to unlock your phone or restore from backup. If you've forgotten that too, you can reset it at iforgot.apple.com using your recovery email or phone number.
Frequently Asked Questions
Will I lose my photos and messages if I use the Apple ID unlock method?
No. Using your Apple ID to unlock from the lock screen keeps all your data intact. You're only changing your passcode, not erasing the phone. Recovery mode is the only method that erases everything, and you should only use it if the other two methods don't work.
What if I don't remember my Apple ID password either?
Go to iforgot.apple.com on any computer or phone and enter your Apple ID email. Apple will send a reset link to your recovery email or a code to your phone number. Reset your Apple ID password there, then use that new password to unlock your iPhone from the lock screen.
How long does recovery mode take?
The read and installation usually takes 30 minutes to an hour, depending on your internet speed and which iPhone model you have. Newer iPhones tend to be faster. After it finishes, set up your phone and sign in with your Apple ID to restore from backup if you have one.
Can Apple Support help me unlock my iPhone without erasing it?
Apple Support can help you reset your Apple ID password or send you a recovery code if you're locked out of two-factor authentication. They cannot unlock your iPhone directly. You have to use one of the three methods above. Call 1-800-MY-APPLE if you're stuck on any of these steps.
What if my iPhone is disabled and says "iPhone Unavailable"?
This happens after too many wrong passcode attempts. Wait for the timer to count down — it starts at 5 minutes and gets longer with each failed attempt. Once the timer runs out, try again. After enough failed attempts, you'll see the Apple ID unlock option, or you can use recovery mode.