You cannot retrieve a forgotten iPhone passcode, but you can reset it

Apple does not store your passcode anywhere, which means no one — not Apple, not your carrier, not a technician — can tell you what it is. This is intentional: it keeps your phone secure even if someone breaks into Apple's servers. The trade-off is that if you forget your passcode, your only option is to erase the phone and set it up again.

The method you use depends on whether you have access to a computer, whether you remember your Apple ID password, and which version of iOS your phone is running. Most people can reset their passcode in under an hour using one of the routes below.

Key Takeaways

  • Apple cannot retrieve your passcode because it is not stored anywhere — you must erase and reset your phone instead.
  • If you remember your Apple ID password, you can reset your passcode using Find My iPhone from any web browser or another device.
  • If you do not remember your Apple ID password, you will need a computer and a USB cable to erase your phone using Finder or iTunes.
  • After erasing your phone, you will set up a new passcode during the setup process and can restore your data from a backup if one exists.

Reset your passcode using Find My iPhone (fastest method)

If you remember your Apple ID email and password, you can reset your passcode from any web browser without a computer or cable. Go to iCloud.com, sign in with your Apple ID, and select Find My iPhone. Tap All Devices at the top, then select your iPhone from the list.

Tap Erase iPhone. This will wipe your phone completely. When the process finishes, your phone will show the setup screen. You will be asked to create a new passcode during setup. If you have a backup stored in iCloud, you can restore your photos, messages, and apps after you finish setting up.

This method works on any iPhone model and any recent iOS version. The phone must be connected to the internet for the erase to work — if your phone is offline, the erase will happen the next time it connects.

Reset your passcode using a computer and USB cable

If you do not remember your Apple ID password, or if Find My iPhone is not working, you will need a Mac or Windows computer and the USB cable that came with your iPhone. Connect your phone to the computer with the cable.

On a Mac running macOS Monterey or newer, open Finder, click your iPhone in the sidebar under Locations, and click General. Click Restore. On a Mac running an older version of macOS, or on Windows, open iTunes instead, select your iPhone, and click Restore. Either way, you will be asked to confirm that you want to erase the phone. Click Restore again.

The computer will download the current version of iOS and install it on your phone. This takes 10 to 30 minutes depending on your internet speed. When it finishes, your phone will show the setup screen, and you will create a new passcode.

What happens to your data after you reset

Erasing your phone deletes everything on it: photos, messages, contacts, apps, and settings. However, if you backed up your phone to iCloud or to a computer before you forgot your passcode, you can restore that backup after setup is complete.

During the setup process, you will be asked whether you want to restore from a backup. If you choose yes, your phone will download your data from iCloud or from the computer you used to back it up. This can take anywhere from a few minutes to an hour depending on how much data you have and how fast your internet is.

If you do not have a backup, your phone will start fresh with no photos, messages, or apps. You can download your apps again from the App Store, and you can recover some messages and photos from iCloud if you have iCloud Photos or iCloud Mail turned on.

Prevent this from happening again

Write your passcode down and store it somewhere safe — a locked drawer, a password manager, or a trusted family member. Do not store it in your phone's notes app or in a text message, since someone with access to your phone could read it.

Turn on iCloud Backup so your phone backs up automatically every night when it is plugged in and connected to Wi-Fi. Go to Settings > [Your Name] > iCloud > iCloud Backup and turn it on. This way, if you ever need to erase your phone, you can restore everything afterward.

Make sure you remember your Apple ID password, or store it in a password manager. Your Apple ID is the key to resetting your passcode remotely, so losing access to it makes recovery much harder.

If you cannot remember your Apple ID password either

If you have forgotten both your passcode and your Apple ID password, recovery takes longer but is still possible. Go to iforgot.apple.com and enter your Apple ID email. Apple will send you a link to reset your password. You may be asked to answer security questions or verify your identity using a phone number or email address you registered with Apple.

Once you have reset your Apple ID password, you can use the Find My iPhone method described above. If you cannot verify your identity through Apple's security questions, you will need to contact Apple Support by phone or through their website. They can help you regain access to your account, though the process may take a few days.

Frequently Asked Questions

Can I reset my passcode without erasing my phone?

No. Your passcode is not stored anywhere Apple can access, so there is no way to retrieve it or change it without erasing the phone first. Any service claiming to recover your passcode without erasing is not legitimate.

What if my phone is disabled and says "iPhone is disabled, try again in X minutes"?

This happens after you enter the wrong passcode too many times. Wait the amount of time shown, then try again. If you do not know the passcode, you will eventually see "iPhone is disabled" with no timer. At that point, you must erase the phone using one of the methods above.

Can I reset my passcode at an Apple Store?

An Apple Store can help you erase your phone and set up a new passcode, but they will use the same methods described here — Find My iPhone or a computer with Finder or iTunes. They cannot retrieve your old passcode. You may need to show proof of purchase or identity.

Will I lose my photos and messages if I reset my passcode?

Only if you do not have a backup. If you have iCloud Backup or a computer backup, you can restore everything after setup. If you do not have a backup, you will lose anything not stored in iCloud Photos, iCloud Mail, or other cloud services.

How long does it take to reset my passcode?

Using Find My iPhone takes 10 to 20 minutes. Using a computer takes 30 to 60 minutes depending on your internet speed and how much data you are restoring. If you also need to reset your Apple ID password, add another 10 to 15 minutes.