What to do if you're locked out of your own iPhone

If you've forgotten your passcode, you have several ways to regain access to your iPhone. The method that works depends on whether you remember your Apple ID password, whether you have a trusted device nearby, and how much data you're willing to erase. Apple's built-in recovery options exist specifically for this situation — you don't need to visit a store or contact Apple Support unless you've also lost access to your Apple ID.

The fastest route is usually through a trusted device or your Apple ID password. If neither is available, you can erase the iPhone and set it up fresh, though this removes all data that wasn't backed up to iCloud.

Key Takeaways

  • If you remember your Apple ID password, you can unlock your iPhone through iCloud.com or another Apple device without erasing anything.
  • If you have a trusted iPhone, iPad, or Mac nearby, you can use it to reset your passcode directly on the locked phone.
  • If you have neither your Apple ID password nor a trusted device, you must erase the iPhone using a computer and Apple's Finder or iTunes, which removes all local data.
  • After unlocking, you can restore your data from an iCloud backup if one exists, or set up the phone as new.
  • If you've forgotten both your passcode and your Apple ID password, you'll need to recover your Apple ID through Apple's account recovery process before you can unlock the phone.

Unlocking with your Apple ID password on iCloud.com

This method works if you remember your Apple ID password and your iPhone is connected to the internet (either Wi-Fi or cellular). Go to iCloud.com on any computer or phone, sign in with your Apple ID, and select Find My iPhone. Locate your locked iPhone in the device list, tap it, and choose Erase iPhone. This removes your passcode without erasing your data — when you set up the phone again, you'll sign back in with your Apple ID and restore everything from your iCloud backup.

After you erase the phone this way, it will show a setup screen. Sign in with your Apple ID, choose to restore from your iCloud backup, and your apps, photos, messages, and settings will return. This process takes 15 minutes to an hour depending on how much data you have and your internet speed.

Using a trusted device to reset your passcode

If you have another iPhone, iPad, or Mac that you've previously used to sign into your Apple ID, you can reset your passcode without erasing anything. On the trusted device, open Settings (iPhone or iPad) or System Settings (Mac), tap or click your name at the top, then select Password & Security. Choose Change Passcode, then select Change Passcode on iPhone (or the device name). You'll be asked to authenticate with Face ID, Touch ID, or your device password, then enter a new passcode on the locked iPhone.

This method keeps all your data intact and takes only a few minutes. The locked iPhone must be nearby and connected to Wi-Fi or cellular for this to work.

Erasing and restoring your iPhone through a computer

If you don't remember your Apple ID password and don't have a trusted device, you'll need to erase the iPhone using a computer. Connect your iPhone to a Mac or Windows PC with a USB cable. On a Mac running macOS Monterey or newer, open Finder and select your iPhone in the sidebar, then click Restore. On Windows or older Mac, use iTunes instead. Choose Restore, and Apple's software will erase the phone and install the latest iOS version.

After the erase completes, the iPhone will show the setup screen. You can now set it up as a new device or sign in with your Apple ID to restore from a backup. This process erases all data stored on the phone itself, though you'll recover everything if you have an iCloud backup and sign back in with your Apple ID.

What happens if you've also forgotten your Apple ID password

If you can't remember your Apple ID password and don't have a trusted device, you'll need to recover your Apple ID before you can unlock the iPhone. Go to iforgot.apple.com on any device, enter your Apple ID email address, and follow Apple's recovery steps. You may be asked to verify your identity through a trusted phone number, a recovery key, or security questions you set up previously.

Once you've regained access to your Apple ID, you can use the iCloud.com method described above to unlock your iPhone. This adds extra time to the process — account recovery can take anywhere from a few minutes to several days depending on which verification method you use.

Preventing lockouts in the future

Write your passcode somewhere secure outside your phone — a physical notebook in a safe place, or a password manager on your computer. Set up two-factor authentication on your Apple ID so you can verify your identity through a trusted phone number or device. Enable iCloud backup in Settings so that if you do get locked out and have to erase, your data isn't permanently lost. Consider using Face ID or Touch ID as your primary unlock method, since these are harder to forget than a numeric code.

If you use a password manager like 1Password, Bitwarden, or the built-in password manager in your browser, you can store your Apple ID password there as well. This keeps it safe and retrievable if you need it.

When to contact Apple Support

You should contact Apple Support if you've tried the methods above and they don't work, or if you believe your iPhone was locked by someone else without your permission. Apple Support can verify your identity and help you regain access, though this process is slower than the self-service options and may require proof of purchase.

If your iPhone is under warranty or you have AppleCare+, you can also visit an Apple Store in person. Bring a photo ID and proof of purchase if you have it. The store can help you unlock the phone or, if necessary, replace it.

Frequently Asked Questions

Can I unlock my iPhone if it's not connected to the internet?

No. All of Apple's unlock methods require an internet connection to verify your identity. If your iPhone is offline, connect it to Wi-Fi or cellular data first. If you can't connect to the internet, you'll need to use the computer-based erase method, which requires a USB connection to a Mac or Windows PC.

Will unlocking my iPhone delete my photos and messages?

Only if you erase the phone through a computer without a backup. If you unlock through iCloud.com or a trusted device, nothing is deleted. If you do erase, you can restore your photos and messages from an iCloud backup when you sign back in with your Apple ID — as long as a backup exists.

How long does it take to unlock an iPhone?

Using iCloud.com or a trusted device takes 5 to 15 minutes. Erasing through a computer takes 10 to 30 minutes depending on your iPhone model and iOS version. Recovering a forgotten Apple ID can take anywhere from a few minutes to several days depending on which verification method Apple requires.

What if I don't have access to my Apple ID email address anymore?

You can still recover your Apple ID if you have access to a recovery phone number or recovery key you set up previously. Go to iforgot.apple.com and choose the verification method that works for you. If you have none of these, contact Apple Support with proof of identity and purchase.

Can someone else unlock my iPhone if they know my Apple ID password?

Yes, which is why protecting your Apple ID password is as important as protecting your passcode. Use a strong, unique password and enable two-factor authentication so that even if someone has your password, they can't access your account without a verification code sent to your trusted phone number or device.