If your iPhone says your passcode is wrong even though you are sure it is correct, the fix is usually a forced restart, a software update, or a restore from a backup — and in some cases, the phone needs to be erased and set up as new. This guide walks through the most common causes and the exact steps to get back into your device without losing more data than necessary.
Why Your iPhone Suddenly Rejects the Correct Passcode
A passcode that worked yesterday can stop working today for a few distinct reasons. The most common is a software glitch in the lock screen or the Secure Enclave (the dedicated chip that stores your passcode and encryption keys). iOS updates, restored backups, or even a low battery can occasionally corrupt the passcode verification process. Another frequent cause is a stuck or dirty key on the number pad — if you type 1234 and the phone registers 1235, every attempt fails. Less common but possible: the phone was restored from an iCloud or iTunes backup that had a different passcode, so the device expects that older code. In rare cases, the Secure Enclave itself fails, which requires a hardware repair.
First: Force Restart Your iPhone
A forced restart clears temporary software errors without erasing any data. This is the single most effective fix for a passcode that suddenly stops being accepted.
- Press and quickly release the Volume Up button.
- Press and quickly release the Volume Down button.
- Press and hold the Side (power) button until you see the Apple logo, then release.
This works on iPhone 8 and newer, including all Face ID models. For iPhone 7 and 7 Plus, hold the Side button and Volume Down together. For iPhone 6s and earlier, hold the Home button and the top or Side button together. After the restart, try your passcode again. If it still fails, move to the next step.
Check for a Stuck Key or Display Issue
If the restart doesn’t help, the problem may be physical. A dirty or slightly stuck key on the passcode pad can register a different digit than you press. Clean the screen with a soft, dry cloth. If you have a screen protector, remove it — a damaged protector can cause phantom touches or missed taps. Also check whether the screen responds correctly elsewhere: open the camera or a notes app and tap around. If touches are registering in the wrong spot, the digitizer is faulty and needs repair. In that case, you may still be able to unlock via Face ID or Touch ID if those sensors work, but you’ll need to disable the passcode requirement temporarily in Settings, which is only possible if the phone is already unlocked.
When to Use Recovery Mode and Restore
If a force restart and cleaning don’t work, the next step is to put the iPhone in recovery mode and restore it. This erases the device and installs the latest iOS, which will remove the corrupted passcode data. You will need a computer with the latest version of iTunes (Windows) or Finder (macOS Catalina or later).
- Connect your iPhone to the computer with a cable.
- Put the iPhone in recovery mode: press and release Volume Up, press and release Volume Down, then hold the Side button until the recovery mode screen appears (a computer icon and a cable).
- On the computer, a dialog will appear offering to Update or Restore. Choose Restore.
After the restore finishes, the iPhone will boot to the “Hello” screen. You can set it up as new or restore from a backup. Important: if you restore from a backup, the passcode from that backup will be required. If you don’t know it, you’ll be stuck again. In that case, set up as new and then sign into iCloud to pull back contacts, photos, and other data.
What About “iPhone is Disabled” or “Security Lockout”?
After too many failed attempts, the iPhone disables itself for increasing periods (1 minute, 5 minutes, 15 minutes, etc.) and eventually says “iPhone is disabled, connect to iTunes.” This is a security feature, not a bug. You cannot bypass it by waiting forever — the lockout time resets only after a successful passcode entry or a restore. If you are in this state, the only option is to restore via recovery mode (as above). Do not keep guessing passcodes; each wrong attempt extends the lockout and can eventually require a full erase. If you have a recent iCloud backup, you won’t lose much. If you never backed up, a restore will erase everything, so always keep backups enabled.
If You Forgot the Passcode Entirely
If you genuinely don’t remember the passcode, there is no way to unlock the phone without erasing it. Apple does not provide any backdoor or passcode recovery service. The only official method is to restore the device using recovery mode, which wipes all data. After that, you can restore from a backup made before you forgot the code. If you have iCloud Backup enabled, the phone likely backed up automatically when it was on Wi-Fi and charging. Check iCloud.com to see if a recent backup exists. If you have no backup, your data is unrecoverable. This is why two-factor authentication and a written backup of your passcode (kept somewhere safe) are strongly recommended.
Preventing This From Happening Again
To avoid a future lockout, take these steps:
- Enable iCloud Backup and confirm it runs regularly (Settings > your name > iCloud > iCloud Backup).
- Write down your passcode and store it in a secure place, not on a sticky note on your desk.
- Update iOS regularly — Apple patches bugs that can cause passcode verification failures.
- Avoid using a passcode that is easy to misremember, like a pattern or a date you might confuse.
- If you use Face ID or Touch ID, keep the passcode simple enough to type accurately but not so simple that others can guess it.
Frequently Asked Questions
Why does my iPhone say my passcode is wrong when I know it’s right?
This usually points to a software glitch in the lock screen or Secure Enclave, a stuck key on the number pad, or a restored backup that expects a different passcode. A forced restart fixes the glitch in many cases; if not, a recovery mode restore is needed.
Can I unlock my iPhone without erasing it if I forgot the passcode?
No. Apple intentionally provides no way to bypass the passcode without erasing the device. The only official path is a recovery mode restore, which wipes all data. Your only hope is a recent backup.
How long does the iPhone lockout last after too many wrong attempts?
Lockout times escalate: 1 minute, 5 minutes, 15 minutes, 60 minutes, and then “iPhone is disabled.” The timer resets only after a correct passcode or a restore. Guessing more just extends the lockout.
Will a restore from a backup bring back my passcode?
Yes, but only the passcode that was set when that backup was made. If you restore from a backup, the phone will ask for the passcode from that backup, not the one you forgot. If you don’t know it, you’ll be locked out again.
Does a factory reset remove the passcode?
Yes, a factory reset (via recovery mode or Settings > General > Transfer or Reset iPhone) removes the passcode and all data. After the reset, the phone is as new and you can set a new passcode. But you’ll lose everything unless you have a backup.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Missing Scroll Bar in Chrome
- Fix Sony Vegas Crashing on Windows 10
- Fix Outlook Sent Items Missing? Quick Solutions
- Declutter Safari on iPhone: 15 Quick Tips
- Fix Google Maps Timeline Not Working on iPhone & Android
- How to Find Hidden Apps on iPhone (Unhide Guide)