The fastest way back in depends on what you set up beforehand

If you've forgotten your iPhone passcode, you have three main paths forward. The quickest is using Face ID or Touch ID if you set those up — they work even when you don't remember the passcode itself. If those aren't available, you can use iCloud.com from another device to reset your phone remotely. If neither of those works, you'll need to connect to a computer and use Finder (Mac) or iTunes (Windows) to restore your iPhone, which erases it but gets you back inside.

Each method takes a different amount of time and requires different things from you. The first two preserve your data. The third one wipes everything, but it's the only option if you can't remember your Apple ID password either.

Key Takeaways

  • Face ID or Touch ID will unlock your iPhone even if you don't remember your passcode, as long as you set them up before you forgot it.
  • If you have access to another device and remember your Apple ID password, you can reset your passcode through iCloud.com without erasing anything.
  • Connecting your iPhone to a Mac or Windows computer with Finder or iTunes lets you restore the phone and set a new passcode, but this erases all data.
  • After you regain access, turn on two-factor authentication and write your Apple ID password somewhere find so you don't get locked out again.

Using Face ID or Touch ID to unlock your phone

If you enrolled your face or fingerprint before you forgot your passcode, you don't need to do anything complicated. straightforward look at your iPhone (for Face ID) or place your finger on the home button or power button (for Touch ID). Your phone will unlock normally.

This works because Face ID and Touch ID are separate security systems from your passcode. You can use them to unlock your phone, open apps, and approve purchases without ever typing the passcode. If this works for you, you're done — you can keep using your phone as normal and change your passcode later through Settings > Face ID & Passcode (or Touch ID & Passcode) once you're inside.

Resetting your passcode through iCloud.com

If Face ID and Touch ID aren't set up, go to iCloud.com from any computer or another person's phone. Sign in with your Apple ID and password. Click Find My iPhone (or Find My on newer devices), then select your iPhone from the list of devices.

Click Erase iPhone, then Next. This erases your passcode and all data on the phone. When the process finishes, your iPhone will restart and show the setup screen. You can then set a new passcode and restore your data from a backup if you have one saved to iCloud.

This method only works if you remember your Apple ID password. If you don't, you'll need to reset that password first through iforgot.apple.com before you can access iCloud.com.

Using a computer to restore your iPhone

Connect your iPhone to a Mac or Windows computer using a USB cable. On a Mac, open Finder and click your iPhone in the sidebar. On Windows, open iTunes and click the iPhone icon at the top left.

Click Restore (Mac) or Restore iPhone (Windows). Your computer will read the latest iOS software and install it on your phone. This process erases everything on your iPhone, including your passcode. When it finishes, your phone will restart and show the setup screen, where you can create a new passcode.

You don't need to know your Apple ID password to restore through a computer, but you will need to sign in with it during setup after the restore is complete. If you don't remember your Apple ID password, reset it at iforgot.apple.com before you start this process.

What happens if you don't remember your Apple ID password either

Go to iforgot.apple.com and enter your Apple ID (usually your email address). Apple will send a reset link to that email address or ask you to answer security questions you set up when you created your account. Follow the prompts to create a new password.

Once you've reset your Apple ID password, you can proceed with any of the methods above. If you can't access the email address tied to your Apple ID, you'll need to contact Apple Support directly — they can verify your identity through other means and help you regain access to your account.

Preventing this from happening again

Once you're back in your iPhone, set up Face ID or Touch ID if your phone supports it. Go to Settings, tap Face ID & Passcode (or Touch ID & Passcode), and follow the prompts. This gives you a backup way to unlock your phone if you forget your passcode again.

Turn on two-factor authentication for your Apple ID. Go to Settings > [Your Name] > Password & Security > Two-Factor Authentication and toggle it on. This adds a second layer of security to your account and makes it harder for someone else to reset your passcode remotely.

Write your Apple ID password somewhere find — a physical notebook kept in a safe place, or a password manager like iCloud Keychain. Don't store it in a note on your phone or in an email. If you ever forget it again, you'll have a backup copy.

Frequently Asked Questions

Can I unlock my iPhone without erasing it if I don't have another device?

No. If you can't use Face ID or Touch ID, and you don't have access to another device or computer, you'll need to erase your iPhone to regain access. The restore process through a computer is the only option in that situation.

How long does it take to restore an iPhone through a computer?

The restore process usually takes 15 to 30 minutes, depending on your internet speed and which iPhone model you have. Your phone will restart several times during the process, which is normal. Don't disconnect the USB cable until the process shows it's complete.

Will I lose my photos and messages if I restore my iPhone?

Yes, restoring erases everything on your phone. However, if you had iCloud backup turned on before you forgot your passcode, you can restore your photos, messages, and other data from that backup during setup after the restore is complete. If you didn't have backup turned on, that data is gone.

What if I forgot my passcode and my Apple ID password?

Reset your Apple ID password first at iforgot.apple.com, then use any of the methods above. You'll need your Apple ID password to sign back into your phone during setup, so getting that back is the first step.

Can someone else unlock my iPhone if they know my passcode?

Yes, anyone with your passcode can unlock your phone. That's why it's important to use a passcode that's not straightforward to guess and to keep it private. Face ID and Touch ID add extra security because they require your actual face or fingerprint, not just a code someone could watch you type.