Start with your phone's built-in recovery option
Your phone has a recovery method built in before you ever set a password. On an iPhone, you can use your Apple ID and a recovery key or trusted device to reset your passcode without losing your data. On Android, you can use your Google account to reset your PIN or pattern lock. Both methods work even if you cannot remember your password — they rely on a different account you set up when you first configured the phone.
The exact steps depend on your phone model and operating system version. For iPhone, go to the lock screen, tap "iPhone Unavailable," then follow the prompts to use your Apple ID. For Android, after several failed attempts, you will see an option to unlock with your Google account. You will need to know the email and password for whichever account you linked to your phone.
Key Takeaways
- Your Apple ID or Google account can unlock your phone without erasing it, as long as you remember that account's password.
- If you do not remember your Apple ID or Google password either, you can recover those accounts using your email address or phone number.
- A factory reset will unlock your phone but will erase all data on it unless you have a backup stored in iCloud or Google Drive.
- If your phone is tied to a work or school account, contact your IT department before attempting any reset — they may have a way to unlock it remotely.
Recover your Apple ID or Google account password
If you cannot remember the password to your Apple ID or Google account, you can reset it using the email address or phone number you registered with. Go to iforgot.apple.com for Apple ID or accounts.google.com/signin/recovery for Google. Both will ask you to verify your identity by entering a code sent to your email or phone, then let you create a new password.
This step takes 10 to 15 minutes and does not require your phone. Once you have reset your account password, go back to your phone's lock screen and use the new password to unlock it. You will not lose any photos, messages, or apps stored on your phone.
Use a computer to unlock your iPhone
If you have a Mac or Windows computer, you can use it to reset your iPhone passcode through iCloud or by connecting the phone directly. On a Mac with macOS Monterey or newer, open Find My, select your iPhone, and choose "Erase iPhone" — this will reset the passcode but keep your data if you have a backup. On Windows or older Mac, connect your iPhone to a computer with iTunes or Finder, put the phone in recovery mode, and restore it from a backup.
These methods require you to know your Apple ID password. If you do not, reset your Apple ID password first using the steps above. The process takes 30 to 60 minutes depending on how much data is on your phone and your internet speed.
Factory reset your phone as a last resort
A factory reset will unlock your phone but will erase everything on it — photos, messages, apps, and settings — unless you have a backup. On iPhone, you can factory reset through iCloud.com by signing in with your Apple ID, selecting Find My, choosing your phone, and selecting "Erase iPhone." On Android, hold the power button and volume down button together for 10 seconds to enter recovery mode, then select "Wipe data / factory reset."
After the reset, your phone will ask you to set it up again from scratch. If you have a backup in iCloud or Google Drive, you can restore your data during setup. If you do not have a backup, you will lose everything that was not synced to the cloud — photos stored only on your phone, text messages, and downloaded apps will be gone.
What to do if your phone is managed by work or school
If your phone is enrolled in a Mobile Device Management (MDM) system through your employer or school, you cannot unlock it yourself. Contact your IT department or help desk and explain that you have forgotten your passcode. They can either reset it remotely or walk you through the process using their system.
Do not attempt a factory reset on a work phone without permission — it may violate your organization's policy or cause you to lose access to work email and apps. Your IT department has tools to unlock the phone without erasing it, so that is always the faster route.
Prevent this from happening again
Once you regain access, write down your passwords in a find place or use a password manager like Bitwarden, 1Password, or the built-in password manager on your phone. Set up biometric unlock — fingerprint or face recognition — so you do not have to type your password every time. Enable two-factor authentication on your Apple ID or Google account so that even if someone learns your password, they cannot access your account without a code sent to your phone or email.
Back up your phone regularly to iCloud or Google Drive. If you ever need to factory reset, you will be able to restore your data instead of losing it. Most phones can be set to back up automatically every night when plugged in and connected to Wi-Fi.
Frequently Asked Questions
How long does it take to unlock my phone?
Using your Apple ID or Google account takes 10 to 15 minutes if you remember that password. Recovering your Apple ID or Google password takes another 10 to 15 minutes. A factory reset takes 30 to 60 minutes depending on your phone's storage and internet speed.
Will I lose my photos and messages?
No, if you unlock using your Apple ID or Google account. Yes, if you factory reset without a backup. Before attempting any reset, check whether you have a backup in iCloud or Google Drive — if you do, a factory reset will restore everything after you set up the phone again.
What if I do not remember my Apple ID or Google password either?
Go to iforgot.apple.com or accounts.google.com/signin/recovery and use your email address or phone number to reset that password. You will receive a code by email or text to verify your identity. Once you reset that password, you can use it to unlock your phone.
Can I unlock my phone without my Apple ID or Google account?
Not without erasing it. A factory reset will unlock your phone, but you will lose all data unless you have a backup. If your phone is managed by work or school, contact your IT department — they may be able to unlock it without a factory reset.
What should I do if I think someone else is trying to unlock my phone?
If your phone is locked and you did not forget the password, do not attempt to unlock it. Contact your phone's manufacturer support or your mobile carrier. If you believe your account has been compromised, change your Apple ID or Google password when ready from a different device.