You can regain access through your Apple ID, a trusted device, or recovery mode — the fastest route depends on what you have available right now

If you've forgotten your iPhone passcode, you have three main paths forward. The quickest is using a trusted device — a Mac, iPad, or another iPhone where you're already signed into your Apple ID — because it takes minutes and doesn't erase anything. The second is signing in with your Apple ID directly on the locked iPhone, which also preserves your data but requires you to remember that password. The third is recovery mode, which erases the phone but works when the other two aren't available. Which one you use depends on what you have access to right now.

Key Takeaways

  • A trusted device you already own — Mac, iPad, or another iPhone — is the fastest way to unlock without erasing anything, and takes about five minutes.
  • If you don't have a trusted device, you can use your Apple ID and password directly on the locked iPhone, but you'll need to remember that password.
  • Recovery mode erases your iPhone completely, so use it only when the other two routes aren't possible.
  • After you regain access, set a passcode you can actually remember, or use a password manager to store it securely.
  • If you've forgotten both your iPhone passcode and your Apple ID password, you'll need to verify your identity through Apple Support or your recovery email address.

Using a trusted device to unlock without erasing

A trusted device is any Mac, iPad, or iPhone where you're already signed into the same Apple ID. If you have one, this is your fastest option because it doesn't erase anything and takes about five minutes.

On your Mac or iPad, open System Settings (Mac) or Settings (iPad) and go to [Your Name] at the top. Tap "Password & Security" and then "Change Passcode." You'll see a prompt asking which device you want to change the passcode on — select your locked iPhone. Enter your Apple ID password, then create a new passcode on your locked iPhone when prompted. The new passcode syncs when ready.

On another iPhone, go to Settings, tap [Your Name], then "Password & Security," then "Change Passcode." Select your locked iPhone from the list, enter your Apple ID password, and create the new code. The unlock happens within a few seconds.

Signing in with your Apple ID directly on the locked phone

If you don't have a trusted device but you remember your Apple ID password, you can unlock the iPhone on the phone itself. This also preserves all your data.

On the locked iPhone, tap "iPhone Unavailable" or "Try Again Later" until you see "Use Recovery Mode" or "Use Apple ID." Tap whichever appears. Enter your Apple ID email and password. You'll be asked to set a new passcode. Once you do, the phone unlocks and you're back in.

This route requires you to remember your Apple ID password — not your passcode, but the password you use to sign into iCloud or the Apple website. If you've forgotten that too, you'll need to reset it through Apple's website before you can proceed.

Recovery mode: when you need to erase and start over

Recovery mode erases your iPhone completely and reinstalls the operating system. Use this only if you don't have a trusted device and you can't remember your Apple ID password. You'll need a Mac or Windows computer and a USB cable.

Connect your locked iPhone to the computer with the cable. On Mac, open Finder and select your iPhone in the sidebar. On Windows, open iTunes. You should see a prompt asking whether to "Update" or "Restore" — choose "Restore." The computer will read the latest iOS version and reinstall it on your phone. This takes 10 to 20 minutes depending on your internet speed.

When the process finishes, your iPhone will restart as if it's brand new. You'll be asked to set it up again — you can sign back into your Apple ID at that point and restore from a backup if you have one in iCloud. If you don't have a backup, you'll start with a blank phone.

What to do if you've forgotten both your passcode and Apple ID password

If you can't remember either one, you'll need to verify your identity to Apple before you can proceed. Go to iforgot.apple.com on any device and enter your Apple ID email. Apple will ask you to verify your identity through one of these methods: answering security questions you set up when you created your account, using a recovery email address you provided, or receiving a verification code on a trusted device.

Once you've verified your identity, you can reset your Apple ID password. After that, use the method described in the "Signing in with your Apple ID" section above to unlock your iPhone. If you don't have access to any of those verification methods, contact Apple Support — they can help you regain access, though the process takes longer.

Protecting yourself from this happening again

The easiest fix is to use a passcode you can actually remember — but if you want something strong that you won't forget, use a password manager. Apps like 1Password, Bitwarden, or even the Notes app with a strong master password let you store your iPhone passcode securely without having to memorize it.

Set up at least one trusted device — a Mac, iPad, or second iPhone — and make sure you're signed into your Apple ID on it. That way, if you forget your passcode again, you have a fast way out without erasing anything. Also write down your Apple ID password and store it somewhere safe, separate from your phone — a physical notebook in a drawer, a password manager, or a trusted person's hands.

Why your iPhone locks you out after wrong attempts

After six wrong passcode attempts, your iPhone disables for 1 minute. After ten wrong attempts, it disables for 5 minutes. After fifteen wrong attempts, it disables for 60 minutes. This is intentional — it slows down anyone trying to guess your code. If you're the person locked out, it's frustrating, but it's also why your data stays safe if someone else gets your phone.

This is also why writing down your passcode or storing it in a password manager matters. Trying to remember it under pressure, with the timer running, usually leads to more wrong guesses and longer lockouts.

Frequently Asked Questions

Can I unlock my iPhone without a computer?

Yes, if you have a trusted device or remember your Apple ID password. Both methods work entirely on the iPhone itself or on another Apple device. You only need a computer if you're using recovery mode, which erases the phone.

Will I lose my photos and messages if I use recovery mode?

Yes — recovery mode erases everything on the phone. However, if you have an iCloud backup, you can restore your photos, messages, and other data after the phone is set up again. Check iCloud.com to see if you have a recent backup before you erase.

What if I don't remember my Apple ID email address?

Go to iforgot.apple.com and enter your phone number or the email address you think might be associated with your account. Apple will search for accounts linked to that information. If you still can't find it, contact Apple Support with proof of purchase — they can help identify your account.

How long does it take to unlock through a trusted device?

Usually two to five minutes. The new passcode syncs to your locked iPhone almost when ready, but sometimes it takes a minute or two for the phone to recognize the change and unlock.

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

Yes — that's why your Apple ID password should be as strong as your iPhone passcode. Use a password manager to store it, and don't share it with anyone. If you think someone has your password, change it when ready at iforgot.apple.com.