If you’ve forgotten your phone passcode, there is no secret code or shop trick that unlocks it with your data intact. Modern iPhones and Android phones encrypt everything behind that passcode, so the realistic options are remembering it, using a reset feature you set up in advance, or erasing the phone and restoring from a backup. Here’s how each path works, and what to have ready before you start.

The short version

  • Stop guessing once the phone starts adding wait times; each wrong attempt brings you closer to a longer lockout or, if you’ve turned on the erase-after-failed-attempts setting, a wiped phone.
  • On recent iPhones, if you changed your passcode in the last 72 hours, you may be able to unlock with the old one.
  • Otherwise, getting back in almost always means erasing the phone and restoring from a backup.
  • You’ll need your Apple Account or Google account password afterwards, because of Activation Lock and Factory Reset Protection.
  • No legitimate repair shop can bypass a passcode on a phone you can’t prove is yours, and data that was never backed up can’t be recovered.

First, slow down and try to remember

It sounds obvious, but a calm minute often works better than ten rushed guesses. People forget passcodes most often right after changing them, after a long break from using a phone, or when switching from a 4-digit code to a 6-digit one (or the other way around).

  • Think about whether you recently changed it, and what the previous code was.
  • Check whether the keypad is asking for digits or for a longer alphanumeric password; a pattern lock on Android is easy to mix up with a PIN.
  • Try the code you use for your other devices, your banking app or your old phone.
  • Stop before the lockout timer grows. Phones add increasing delays after repeated wrong entries, and if you (or an employer) switched on the setting to erase data after a number of failed attempts, the phone will wipe itself.

iPhone: using the Forgot Passcode option

After several wrong attempts, an iPhone shows a lockout screen such as “iPhone Unavailable” or “Security Lockout”. On recent versions of iOS, a Forgot Passcode? option appears at the bottom of that screen.

If you changed your passcode recently

On iOS 17 and later, if you changed your passcode within roughly the last 72 hours, Apple lets you enter your previous passcode to get back in and then set a new one. If the option is offered, it’s the one path that keeps your data on the phone.

Erasing from the lock screen

If that doesn’t apply, the same screen offers to reset the iPhone. You’ll need the phone connected to Wi-Fi or mobile data and your Apple Account password. This erases everything on the device. Once it restarts, you can set it up again and restore from an iCloud or computer backup.

Erasing with a computer

If the lock screen option isn’t available, Apple’s other route is to put the iPhone into recovery mode and connect it to a Mac (using Finder) or a Windows PC (using the Apple Devices app or iTunes), then choose Restore. The button combination for recovery mode depends on the model, so follow Apple’s support instructions for yours. This also erases the phone.

Android and Samsung: your options

Android phones vary by maker, but the main routes are similar.

  • Samsung remote unlock. If you were signed in to a Samsung account and had the remote unlock setting turned on before you got locked out, Samsung’s SmartThings Find website can unlock the phone without erasing it. If it wasn’t turned on in advance, it can’t be switched on now.
  • Google’s Find Hub (formerly Find My Device). From a computer or another phone, signed in to the Google account on the locked phone, you can locate the device and choose to erase it. The phone needs to be on and connected.
  • Recovery mode factory reset. Most Android phones can be reset from a recovery menu reached with a button combination. Look up the exact steps on the maker’s support site for your model.

Any of the erase options removes your apps, photos and files from the phone. What comes back afterwards depends on what was backed up to your Google account, Samsung Cloud or another service.

What happens after you erase the phone

An erased phone isn’t a free-for-all. Apple’s Activation Lock and Android’s Factory Reset Protection ask for the Apple Account or Google account that was on the phone before it can be set up again. That’s a security feature, designed to make stolen phones useless, and it’s why you should confirm you can sign in to your account before you start.

  • Make sure you know your Apple Account or Google account password. If not, recover it first through Apple’s or Google’s account recovery pages.
  • Have access to your trusted phone number or recovery email for two-factor codes. If those codes come to the locked phone itself, a second device or a SIM in another phone can help.
  • Check what your last backup contains, by signing in to iCloud.com or your Google account on a computer.

If you’re preparing for any kind of repair, our guide on backing up your phone before a repair explains what to check so you aren’t caught out next time.

What nobody can do (and why you should be wary)

You’ll find ads and videos promising to “unlock any phone without losing data”. Treat them with a lot of suspicion. On a current, encrypted iPhone or Android phone, the passcode is part of what protects the data, so legitimate tools work through the maker’s own reset process instead of around it.

  • A repair shop can’t recover photos from a locked phone that was never backed up.
  • Nobody legitimate will remove Activation Lock or Factory Reset Protection for you. Those are tied to the owner’s account, and Apple and Google handle account recovery themselves.
  • Downloading “unlock” software from unknown sites can put malware on your computer. If you’re worried something on your phone isn’t right, see how to tell if your phone has been hacked.

If the phone isn’t yours (a found phone, or a used phone that arrived locked), don’t try to reset it. Return a found phone to the owner or local police, and go back to the seller for a used one.

How to avoid getting locked out again

  • Turn on automatic backups. iCloud Backup on iPhone, or Google backup on Android, so a reset is an inconvenience rather than a loss.
  • Use a passcode you’ll actually remember, and store it in a password manager or somewhere safe at home, not on a note in your wallet next to the phone.
  • Set up Face ID, Touch ID or fingerprint unlock, but keep entering your passcode now and then, because phones ask for it after restarts and updates.
  • On Samsung, consider turning on remote unlock in your Samsung account settings while you still can.
  • Keep your account recovery details current: a trusted phone number, recovery email and, for Apple, an optional recovery contact.

If your phone was lost or taken rather than simply locked, follow the steps in what to do in the first hour after a lost or stolen phone instead.

Locked out in Downtown Vancouver? Talk to MyChoice

If you’re locked out and unsure which path fits your phone, or the phone has another problem like a cracked screen or a software fault that’s making it hard to enter your code, bring it to the MyChoice Mobile Repair kiosk on Granville Street in Downtown Vancouver. We can walk you through your options for your model, and we’ll need you to be the owner with access to your account. We’re open every day from 9 AM to midnight. You can see our software and phone repair services, call (236) 785-8300, or ask for a quote before you come in.

Need a hand with your phone?

MyChoice Mobile Repair is a kiosk at 798 Granville St in Downtown Vancouver. Call us, message us or send a quote request.