Forgot your phone's PIN, pattern or passcode
On today's phones there is no way round a forgotten screen lock that keeps the data. The official route is to erase the phone and restore from your backup.
What you seeWrong PIN / Wrong pattern / Try again in 30 seconds / iPhone Unavailable / Security Lockout
Why it is this strict
The screen lock is also the key that encrypts everything on the phone. Without it, the data cannot be read by anyone: not the maker, not a service centre, not a thief. That is what protects you when a phone is stolen. The cost is that a forgotten lock means erasing the phone.
So, before erasing, try properly to remember:
- Wait out the timer and try the PINs you have used elsewhere. Try slowly: after several wrong attempts the waits grow from seconds to hours.
- Try your fingerprint or face if set up. After a restart the phone insists on the PIN, so do not restart it.
- Think of when you last changed the lock, and whether a family member set it.
- A pattern often comes back to the hand, not the head: try it without looking.
Do not keep guessing wildly. Some phones can be set to erase themselves after a number of failures.
What you will need afterwards
After an erase, the phone asks for the account that was on it. This is an anti-theft lock.
- Android: the Google account email and password that was signed in on the phone (Factory Reset Protection).
- iPhone: the Apple Account email and password (Activation Lock).
If you have forgotten those too, recover them first, on another device: accounts.google.com/signin/recovery for Google, iforgot.apple.com for Apple. Without the account, an erased phone remains unusable.
Android
Option 1: a recent Samsung phone with a Samsung account. If "Remote unlock" was enabled, Samsung's SmartThings Find website (signed in with the Samsung account) can unlock the phone and keep the data. This is the one common exception.
Option 2: erase from the web. On another device open android.com/find, sign in with the phone's Google account, choose the phone and Factory reset device (Erase device). The phone must be on and online.
Option 3: erase from the lock screen. Some recent Android versions show "Forgot PIN?" or "Erase device" after repeated failures and ask for the Google account password.
Option 4: erase from recovery mode. Switch the phone off and use the button combination for your make to open recovery (often Power + Volume Up; see phone will not turn on), then choose Wipe data/factory reset. Use the volume keys to move and Power to select.
Then set the phone up, sign in with the same Google account, and restore your backup.
iPhone
Option 1: erase from the lock screen. After several wrong passcodes the screen shows "iPhone Unavailable" or "Security Lockout" with Forgot Passcode? (iOS 17) or Erase iPhone (iOS 15.2 and 16) at the bottom. Tap it, enter the Apple Account password, and the phone erases itself. It must have a network connection.
iOS 17 and later adds a helpful exception: for 72 hours after you change your passcode, "Forgot Passcode?" offers Try Passcode Reset, which lets you enter the previous passcode and set a new one, keeping the data.
Option 2: erase with a computer. Switch the iPhone off. Hold the Side button while connecting it to a Mac or PC (iPhone 8 and later) and keep holding until the recovery-mode screen appears. In Finder, the Apple Devices app or iTunes choose Restore.
Option 3: erase from the web. icloud.com/find › the iPhone › Erase This Device.
Then set it up, sign in with your Apple Account, and restore from iCloud or computer backup.
What comes back, and what does not
- Comes back: whatever was in your last backup, and everything stored in your accounts: contacts, calendars and email in Google or iCloud; photos if Google Photos or iCloud Photos backup was on; WhatsApp chats if its backup was on.
- Lost: anything created since the last backup and kept only on the phone. If there was no backup, photos and files on the phone are gone.
A phone that still unlocks by fingerprint or face can be backed up now, before the next restart demands the PIN. See back up your phone.
Beware
- Videos, apps and shops that promise to "unlock any phone without data loss" for current phones are false. Many are scams or install malware on your computer.
- A second-hand phone that asks for a previous owner's account after reset cannot be freed by you. Only that person can remove it from their account. Check this before buying a used phone.
- Never give your Google or Apple password to an "unlocking service".
For next time
Choose a PIN you will not forget but others cannot guess, keep fingerprint or face unlock on, keep automatic backup on, and write the account email and recovery details somewhere safe at home.
Can the service centre unlock my phone without erasing it?
No. Authorised centres also erase the phone, and will ask for proof of purchase.
Is there a "master PIN" or code?
No. Lists of such codes on the internet do not work on modern phones.
For Android phones and iPhones. Written in November 2026 for Android 13 to 15 and iOS 17 and 18. Phone makers rename menus; use the search box in Settings if a name differs. Back up before any reset. This is an independent guide, not connected with Google, Apple, Samsung or any phone maker or operator.