The fastest way back in: use a trusted device or phone number

If you have another Apple device signed into the same iCloud account — an iPad, Mac, or Apple Watch — you can reset your passcode without erasing anything. Open Settings on that device, go to iCloud, find the option for Find My iPhone, and use it to reset the passcode remotely. Your iPhone will stay intact and all your data remains.

If you don't have another device, the next fastest route is to use a phone number or email address you registered with your Apple ID. Apple will send a code to that number or address, and you can use it to create a new passcode without losing your photos, messages, or apps. This works as long as you remember your Apple ID email and can receive messages at the phone number or email on file.

Key Takeaways

  • A second Apple device signed into your iCloud account can reset your passcode in minutes without erasing your iPhone.
  • If you remember your Apple ID email and have access to a recovery phone number or email, you can reset the passcode and keep all your data.
  • Connecting to a computer with iTunes or Finder lets you restore your iPhone, but this erases everything — use it only if the other methods don't work.
  • If you're locked out of your Apple ID as well, you'll need to verify your identity through Apple's account recovery process, which takes a few days.
  • Setting up a recovery contact or recovery key now prevents this problem in the future.

Resetting your passcode through iCloud on another device

Open Settings on your iPad, Mac, or Apple Watch. Tap or click iCloud, then find Find My (or Find My iPhone on older devices). Look for the option to find devices or manage devices, and select your locked iPhone from the list.

Choose the option to erase iPhone or reset passcode — the exact wording depends on your device and iOS version, but it will be clearly labeled. Confirm your choice. Your iPhone will receive the command and the passcode will reset. You'll then be prompted to create a new passcode the next time you turn on or unlock your iPhone.

This method works when ready if your iPhone is connected to the internet and you're signed into the same iCloud account on both devices. Your photos, messages, and installed apps stay exactly as they were.

Using your Apple ID email and recovery phone number

On your locked iPhone, tap the option to reset your passcode (usually visible after several failed attempts). You'll be asked to enter your Apple ID email address. Type it in carefully — this is the email you use to sign into iCloud, not necessarily your main email.

Apple will send a verification code to the phone number or email address associated with your Apple ID. If you have access to that number or email, open the message and copy the code. Enter it on your iPhone, and you'll be able to create a new passcode without erasing your device.

If the recovery phone number or email is outdated and you no longer have access to it, you'll need to move to the next step. Don't guess — entering the wrong code multiple times will lock you out further.

Restoring your iPhone through a computer

If the methods above don't work, you can connect your iPhone to a Mac or Windows computer running iTunes (Windows) or Finder (Mac). Plug in your iPhone with a USB cable. Your computer should recognize it and offer options to restore or update the device.

Choose Restore. This will erase your iPhone completely and install a fresh copy of iOS. After the restore finishes, you'll set up your iPhone as new or restore from a backup — but only if you have a backup saved to that computer or to iCloud from before you forgot the passcode.

This method erases everything on your iPhone, so use it only if you've tried the other routes and they didn't work. The upside is that it almost always succeeds, even if you're locked out of your Apple ID.

What to do if you're also locked out of your Apple ID

If you don't remember your Apple ID password or can't receive codes at your recovery email or phone number, you'll need to go through Apple's account recovery process. Visit iforgot.apple.com on any device and enter your Apple ID email. Apple will walk you through verifying your identity — usually by answering security questions or confirming recent purchases.

Account recovery typically takes a few days because Apple verifies your identity carefully to prevent fraud. During this time, you won't be able to reset your iPhone passcode through iCloud. Once your account is recovered, you can use the methods described above to reset your passcode.

If you have a recovery key (a 28-character code you may have saved when setting up two-factor authentication), you can speed this up. Have that code ready when you start the recovery process.

Preventing this from happening again

Once you're back into your iPhone, take a few minutes to set up protections against this happening again. In Settings, go to iCloud and turn on Find My iPhone if it's not already on — this is what lets you reset your passcode from another device.

Add a recovery contact: go to Settings, tap your name, then Password & Security, and choose Recovery Contact. Pick someone you trust who also has an Apple device. If you get locked out in the future, they can help you regain access without needing to erase your phone.

If you use a complex passcode, write it down and store it somewhere safe — not on your phone. A password manager like iCloud Keychain (built into iOS) can also store your passcode securely, though you'll need to remember your Apple ID password to access it.

Frequently Asked Questions

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

After six incorrect attempts, there's a one-minute delay before you can try again. After ten incorrect attempts, the delay grows to five minutes. After fifteen incorrect attempts, your iPhone disables passcode entry for one hour. After that, the delays keep increasing. Don't keep guessing — move to one of the reset methods instead.

Will resetting my passcode delete my photos and messages?

Not if you use a second Apple device or your recovery phone number and email. Both methods reset the passcode while keeping your data intact. Only the computer restore method (Finder or iTunes) erases everything, and you should only use that if the other methods fail.

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

Yes. You can reset the passcode using a second device, a recovery phone number, or a recovery email — none of these require your Apple ID password. You only need your Apple ID email address. If you don't remember that either, you'll need to go through account recovery at iforgot.apple.com.

What if I don't have another Apple device or access to my recovery email?

Your only option is to restore your iPhone through a computer using Finder (Mac) or iTunes (Windows). This erases everything, but it will let you set up your iPhone again. If you have a backup saved to that computer from before you forgot the passcode, you can restore your data after the setup is complete.

How long does it take to reset my passcode?

Using another Apple device takes a few minutes. Using a recovery phone number or email takes as long as it takes to receive and enter the code — usually under five minutes. Computer restore takes 15 to 30 minutes depending on your internet speed. Account recovery through Apple takes a few days.