How to regain access when you've forgotten your passcode

If you can't remember the passcode to unlock your iPhone, you have three main paths forward: use a trusted device or phone number to reset it through Apple's Find My iPhone service, erase the phone and set it up again from a backup, or take it to an Apple Store where staff can verify your identity and help you regain access. Which path works depends on whether you have access to other Apple devices, whether you remember your Apple ID password, and how much data you want to preserve.

The fastest route for most people is using Find My iPhone on another device — a Mac, iPad, or another iPhone you own. If you don't have a second device, you can reset your passcode using your phone number or email address, though this takes longer and requires you to wait for verification codes. If neither of those works, erasing the phone and restoring from a backup is the next step.

Key Takeaways

  • Find My iPhone on a second device (Mac, iPad, or another iPhone) is the fastest way to reset your passcode without losing data.
  • If you don't have a second device, you can reset your passcode by answering security questions or receiving a code at your phone number or email address.
  • Erasing your iPhone and restoring from an iCloud or computer backup will let you set a new passcode, but takes 30 minutes to an hour.
  • Apple Store staff can help you regain access if you can show a photo ID matching the name on your Apple ID account.
  • If you don't remember your Apple ID password either, you'll need to reset that first through iforgot.apple.com before you can erase and restore your phone.

Using Find My iPhone from another device

This method works if you own a Mac, iPad, or another iPhone. On that device, open Find My (on Mac or iPad) or Find My iPhone (on another iPhone). Sign in with your Apple ID — the same one linked to the locked iPhone. Tap or click the Devices tab, select your locked iPhone from the list, and choose "Erase iPhone."

After the phone erases, you'll see a setup screen. You can then create a new passcode. If you have an iCloud backup from before you forgot the passcode, you can restore from that backup during setup, which will bring back your photos, messages, and apps without restoring the old passcode. This method preserves your data and takes about 15 to 20 minutes.

If you don't have access to another Apple device, move to the next method.

Resetting your passcode using your phone number or email

If you're locked out and don't have a second device, you can reset your passcode on the iPhone itself, but it requires you to answer security questions or receive a verification code. On the locked iPhone, tap "iPhone Unavailable" or "Try Again Later" until you see the option to reset using your phone number or email address.

Apple will send a code to the phone number or email address associated with your Apple ID. Enter that code on your iPhone, then answer your security questions (the ones you set up when you created your Apple ID). Once you've answered correctly, you can create a new passcode. This process usually takes 10 to 15 minutes, but the code may take a few minutes to arrive.

If you don't remember the answers to your security questions, or if you can't receive codes at either your phone number or email, you'll need to erase the phone instead.

Erasing your iPhone and restoring from backup

If the methods above don't work, you can erase your iPhone completely and set it up again. To do this, you'll need to remember your Apple ID password. If you don't, go to iforgot.apple.com on a computer or another device and reset your Apple ID password first.

Once you know your Apple ID password, on your locked iPhone, go to Settings > General > Transfer or Reset > Erase All Content and Settings. You'll be asked for your Apple ID password. Enter it, then confirm that you want to erase. The phone will restart and show the setup screen. During setup, you can choose to restore from an iCloud backup (if you have one) or set up as a new phone.

Restoring from a backup brings back your photos, messages, contacts, and apps, but it takes 30 minutes to an hour depending on how much data you have and your internet speed. If you don't have a backup, you'll lose any data that wasn't synced to iCloud.

What to do if you don't remember your Apple ID password

Your Apple ID password is separate from your iPhone passcode. If you've forgotten both, you need to reset your Apple ID password first before you can erase your phone. Go to iforgot.apple.com on a computer, tablet, or another phone. Enter your Apple ID email address, then choose how you want to reset it — usually by receiving a code at your phone number or email address.

Apple will send you a code. Enter it, create a new password, and write it down somewhere safe. Once you've reset your Apple ID password, you can go back to your iPhone and use the "Erase All Content and Settings" method described above.

Getting help at an Apple Store

If none of the above methods work, or if you're not comfortable doing them yourself, you can visit an Apple Store. Bring a photo ID that matches the name on your Apple ID account. Apple staff will verify your identity and can help you regain access to your phone. They may ask you to sign in with your Apple ID on the spot, or they may erase the phone and help you set it up again.

Wait times at Apple Stores vary, so it's worth checking the store's website or calling ahead to see if you need to make an appointment. Some stores offer walk-in service, but during busy hours you may wait 30 minutes to an hour.

How to avoid this in the future

Write your passcode down and store it somewhere find — a physical notebook in a locked drawer, or a password manager like 1Password or Bitwarden that you can access from another device. Don't store it in Notes on your iPhone, because you won't be able to access it if you're locked out.

Turn on biometric unlock (Face ID or Touch ID) so you don't have to type your passcode every day. You'll still need to know it for security updates and when you restart your phone, but you'll use it less often and be less likely to forget it. If you do forget it, you'll have had fewer chances to mistype it repeatedly and trigger the lockout timer.

Frequently Asked Questions

How many times can I try my passcode before my iPhone locks me out?

After six incorrect attempts, your iPhone waits one minute before letting you try again. After the tenth incorrect attempt, it waits five minutes. After the fifteenth incorrect attempt, your iPhone disables itself and shows "iPhone Unavailable." At that point, you must wait or use one of the reset methods above.

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

Only if you don't have a backup. If you have an iCloud backup from before you forgot your passcode, you can restore from it during setup and get everything back. If you don't have a backup, erasing the phone means losing any data that wasn't synced to iCloud (like photos stored only on the phone). Always turn on iCloud backup in Settings > [Your Name] > iCloud > iCloud Backup to prevent this.

Can I reset my passcode without knowing my Apple ID password?

If you're using Find My iPhone on another device, no — you need your Apple ID password to sign in to that device. If you're resetting using your phone number or email, you don't need your Apple ID password. If you want to erase and restore, you'll need your Apple ID password. If you don't know it, reset it at iforgot.apple.com first.

How long does it take to restore from a backup?

Restoring from an iCloud backup usually takes 30 minutes to an hour, depending on how much data you have and your internet speed. A backup with 50 GB of photos and videos will take longer than a backup with 5 GB. Restoring from a backup on a computer (using a cable) is usually faster — 15 to 30 minutes.

What if I don't have access to the phone number or email on my Apple ID?

If you can't receive codes at either address, you'll need to erase your phone and restore from backup (which requires your Apple ID password), or visit an Apple Store with a photo ID. Apple Store staff can verify your identity without needing a code and help you regain access.