The fastest way depends on what you remember and what phone you have

If you've forgotten your phone password, the path forward depends on whether you're locked out of an iPhone or Android device, and whether you remember your Apple ID, Google account, or any backup codes. Most phones let you reset access through your account rather than through the phone itself — this is actually a security feature, because it proves you own the account tied to the device.

The process takes anywhere from a few minutes to a few hours, depending on which method works for your situation. You'll need access to a computer or another device to start most of these processes, because you can't complete them on the locked phone itself.

Key Takeaways

  • iPhone users can reset their password through iCloud.com using their Apple ID, which works even if the phone is locked.
  • Android users can reset their password through their Google account settings on a computer, and the phone will sync the change automatically.
  • Both methods require you to remember your email address and password for your Apple ID or Google account — if you've forgotten those too, you'll need to recover those accounts first.
  • If you set up backup codes or recovery keys when you first secured your phone, those codes can unlock it without resetting your password.
  • Factory reset is the last option and erases everything on the phone, so use it only when you cannot recover your account access.

Resetting an iPhone through iCloud

Go to iCloud.com on any computer or another device and sign in with your Apple ID — the email address and password you use for your iPhone. Once you're logged in, click "Find My" (or "Find My iPhone" on older versions of iCloud).

Select your iPhone from the list of devices. Click "Find My iPhone" and then choose your device again from the map. You'll see a button labeled "Erase iPhone" — click it. This will erase your phone's password and let you set a new one when the phone restarts. The process takes a few minutes, and your phone will restart on its own.

When your iPhone turns back on, you'll see the setup screen. You can now create a new password. Your photos, messages, and other data will still be there if you backed them up to iCloud before you locked yourself out. If you didn't back up, that data is gone.

Resetting an Android phone through Google Account

On a computer, go to myaccount.google.com and sign in with the Google account linked to your Android phone. Click "Security" in the left menu, then scroll down to "Your devices" and select "Manage all devices."

Find your locked phone in the list and click it. You'll see an option to "Find, find, and Erase Your Device" — click "find Your Device." Enter a new password or PIN in the box that appears. Google will send this new password to your phone, and you can use it to unlock the device within a few minutes.

If you don't see your phone listed, it may not be connected to the internet or may not have location services enabled. In that case, you'll need to use a different method. Make sure your phone is turned on and connected to Wi-Fi or mobile data for this to work.

Using backup codes or recovery keys

If you set up two-factor authentication on your Apple ID or Google account, you may have received backup codes or a recovery key. These are usually a series of numbers or a long alphanumeric string that you saved somewhere safe when you first turned on two-factor authentication.

If you have these codes, you can use them to sign into your account on a computer without needing your password. Once you're signed in through your account, you can reset your phone's password the same way as described above. Check your email, a password manager, or any notes where you might have saved these codes.

Recovering your Apple ID or Google account if you've forgotten that password too

If you don't remember your Apple ID password or Google password, you'll need to recover that account first. Go to iforgot.apple.com (for Apple ID) or accounts.google.com/signin/recovery (for Google) on a computer.

Enter your email address and follow the recovery steps. Both Apple and Google will ask you to verify your identity — usually by sending a code to a backup email address or phone number you set up when you created the account. If you don't have access to those backup contacts, you can answer security questions you set up at the time, though this takes longer.

Once you've recovered your account, you can then use that account to reset your phone's password as described in the sections above.

Factory reset as a last resort

If you cannot remember your Apple ID, Google account, or any backup codes, a factory reset is the only remaining option. This erases everything on your phone — all photos, messages, contacts, and apps — and returns it to the state it was in when it left the factory.

For iPhone, you can do this through iCloud.com by clicking "Find My," selecting your device, and choosing "Erase iPhone." For Android, you can do this by turning the phone off, then holding down the power button and volume down button together until the recovery menu appears. Use the volume buttons to navigate to "Wipe data/factory reset" and press the power button to select it.

After the reset completes, your phone will restart and ask you to set it up as new. You'll be able to create a new password at that point. If you had photos or messages backed up to iCloud or Google Photos, you can restore them after setup is complete.

What to do after you regain access

Once you're back into your phone, write down your new password somewhere safe — a physical notebook, a password manager like Bitwarden or 1Password, or a locked notes app. Set up two-factor authentication on your Apple ID or Google account if you haven't already, and save your backup codes in a safe place.

Turn on automatic backups: iPhone users should enable iCloud backup in Settings > [Your Name] > iCloud > iCloud Backup, and Android users should enable Google One backup in Settings > Google > Manage Your Google Account > Storage. This way, if you lock yourself out again, your data won't be lost.

Frequently Asked Questions

Can I unlock my phone without knowing my Apple ID or Google account password?

Not without a factory reset. If you have backup codes from two-factor authentication, you can use those to sign into your account without your password. Otherwise, you'll need to recover your account first by verifying your identity through a backup email or phone number.

How long does it take to reset my phone password?

If you remember your Apple ID or Google password, the reset takes 5 to 15 minutes. If you need to recover your account first, add another 15 to 30 minutes for the verification process. Factory reset takes about 10 minutes, but you lose all your data.

Will I lose my photos and messages if I reset my password?

No, resetting your password keeps your data intact. A factory reset erases everything. If you had automatic backups turned on, you can restore your photos and messages after setup, even after a factory reset.

What if my phone is turned off?

For iPhone, iCloud methods work even if the phone is off — it will reset when you turn it back on. For Android, the phone needs to be on and connected to the internet for Google Account reset to work. If it's off, turn it on first.

Can someone else unlock my phone if they know my password?

Yes, which is why a strong, unique password matters. If someone has your Apple ID or Google password, they can reset your phone remotely. Use a password manager to create a long password with numbers and symbols, and don't share it with anyone.