If you’ve forgotten your phone passcode, there is no safe shortcut that unlocks it with your data intact. On both iPhone and Android, the official fix is to erase the phone and set it up again, then restore your data from a backup. The good news: if you have a backup and know your Apple Account or Google account password, you can usually get everything back.
The short version
- Keep guessing carefully — each wrong try adds a longer lockout, and too many can trigger a forced erase if that setting is on.
- On a recent iPhone, you may be able to use a passcode you changed in the last 72 hours, or erase the phone right from the lock screen.
- Otherwise, the official route on iPhone and Android is an erase and reset, then restore from a backup.
- After a reset you’ll need the Apple Account or Google account that was on the phone, or it stays locked.
- Be wary of anyone promising to “unlock without losing data” — modern phones are encrypted, so that isn’t realistically possible.
First: stop and think before you guess again
Both iPhone and Android add a waiting period after several wrong attempts, and the delay grows the more you get wrong. On iPhone, the screen eventually shows that the phone is unavailable or in a security lockout. If you (or your workplace) turned on the setting that erases the phone after 10 failed attempts, the phone will wipe itself.
So before you keep trying, take a minute to think about what the code might be:
- Did you recently switch from a 4-digit to a 6-digit code, or to an alphanumeric one?
- Is it a code you use elsewhere — a bank card PIN, an old phone, a door code?
- If it’s an Android pattern, did you draw it starting from a different dot?
- Has someone else in the household set it, such as a parent on a child’s phone?
Try your best guesses slowly rather than rapid-firing through combinations.
iPhone: recently changed passcode? Try the old one
Since iOS 17, if you changed your passcode within the last 72 hours, you can use your previous passcode to get in and set a new one. After a few wrong attempts, look for a Forgot Passcode? option at the bottom of the lock screen and choose the passcode reset option, then enter your old code. This only works during that 72-hour window, and only on iOS 17 or later.
iPhone: erase from the lock screen or with a computer
If the old-passcode option isn’t available, you’ll need to erase the iPhone. There are two ways to do it.
From the lock screen (iOS 15.2 and later)
After enough failed attempts, the lock screen offers an option to erase or reset the iPhone (the wording varies by iOS version, such as Forgot Passcode? or Erase iPhone). You’ll need:
- The phone connected to Wi-Fi or mobile data
- The password for the Apple Account (formerly Apple ID) signed in on the phone
With a computer using recovery mode
If you can’t use the lock-screen option — for example, you don’t know the Apple Account password or the phone has no connection — you can put the iPhone into recovery mode and restore it with a Mac (using Finder) or a Windows PC (using the Apple Devices app or iTunes). The button combination to enter recovery mode depends on your model, so follow Apple’s instructions for your exact phone: If you forgot your iPhone passcode (Apple Support).
Either way, the iPhone is erased. When it restarts, you can restore from an iCloud or computer backup during setup.
Android: what your options are
Android varies more between brands, but the basics are the same.
Old “forgot pattern” tricks no longer work
Very old versions of Android let you unlock with your Google account after too many wrong patterns. That option was removed years ago, and current Android phones have no built-in “reset my PIN” button on the lock screen.
Samsung: remote unlock, if you set it up earlier
Samsung Galaxy phones have a remote-unlock feature tied to your Samsung account, available through Samsung’s Find service (SmartThings Find). It only works if you were signed in to a Samsung account and had remote unlock turned on before you got locked out. If it is set up, it’s worth trying before you erase anything.
Erase remotely or with a factory reset
If nothing else works, you’ll need to reset the phone. You can:
- Erase it remotely using Google’s Find Hub (formerly Find My Device) at google.com/android/find, signed in with the Google account on the phone. The phone needs to be on and connected.
- Factory reset from recovery mode using a button combination (usually involving the power and volume buttons). The exact combination varies by brand and model, so check your manufacturer’s support site.
Both options erase everything on the phone that isn’t backed up.
After the reset: activation and account locks
This part catches a lot of people out. Erasing a phone does not remove its theft protection:
- iPhone: Activation Lock asks for the Apple Account and password that was on the phone before it will finish setting up.
- Android: Factory Reset Protection asks you to sign in with a Google account that was previously on the phone.
If you don’t remember that password, reset it first through Apple’s or Google’s account recovery on another device or computer. If the phone was bought second-hand and still has the previous owner’s account on it, only that person (or the manufacturer, with proof of purchase) can release it. No legitimate repair shop can bypass these locks for you, and you should be suspicious of anyone who offers to.
Can you get your data back?
Modern iPhones and Android phones encrypt their storage, and the passcode is part of what protects that encryption. That’s why an erase is the only official way back in, and why data that was never backed up can’t realistically be recovered from a locked phone.
What you can often recover:
- Photos and videos if iCloud Photos or Google Photos backup was on
- Contacts, calendars and notes synced to your Apple, Google or Samsung account
- Chats from apps like WhatsApp, if their own chat backup was enabled
- A full device backup from iCloud, Google or your computer, if one exists
Once you’re back in, it’s worth making sure backups are running automatically. Our guide on how to back up your phone before a repair walks through the settings on both platforms.
How to avoid being locked out again
- Pick a passcode you’ll remember but others can’t guess — avoid birthdays and 123456.
- Set up Face ID, Touch ID or fingerprint unlock, but still enter your passcode now and then so you don’t forget it (phones ask for it periodically anyway).
- Store your passcode and account passwords in a password manager or a secure place at home.
- On Samsung, consider turning on remote unlock in your Samsung account settings.
- Keep automatic backups on so a reset is an inconvenience, not a disaster.
Locked out because of a broken screen? Davie Mobile can help
Sometimes the problem isn’t a forgotten code at all — a cracked or unresponsive screen can make it impossible to type the passcode you know. In that case a screen repair may get you back in without erasing anything; see our post on what to do with a cracked phone screen. If your phone is stuck in a restore loop or won’t finish recovery, take a look at our software troubleshooting options.
Not sure which situation you’re in? Drop by Davie Mobile at 1717 Davie St in the West End, call (672) 208-6756, or ask us for a quote and we’ll talk you through your options honestly.
Need a hand with your phone?
Davie Mobile is at 1717 Davie St in Vancouver’s West End. Call us or send a quote request.
