What to do if you forgot your passcode

If you forgot your iPhone passcode, you have three main paths forward: use your Apple ID to reset it, restore the phone through a computer, or take it to an Apple Store. Which one works depends on whether you set up Find My iPhone, whether you have access to a computer, and how much time you have. None of these routes will recover your data if you don't have a backup — the phone will erase during the reset process.

The fastest method if you remember your Apple ID password is to use iCloud.com from any web browser. Go to iCloud.com, sign in with your Apple ID, open Find My, select your iPhone, and choose Erase iPhone. This wipes the phone and removes the passcode. You can then set it up again and restore from a backup if you have one saved.

If you don't have access to another device or computer right now, your next option is to go to an Apple Store or an authorized Apple repair location. Bring your ID and proof of purchase if you have it. They can verify your identity and help you reset the phone, though this usually takes an appointment and may take several hours.

Key Takeaways

  • If you remember your Apple ID password, you can reset your iPhone passcode through iCloud.com from any web browser without needing the phone itself.
  • Resetting your passcode erases all data on the phone, so you will lose everything unless you restore from a backup afterward.
  • If you don't have access to iCloud or another computer, an Apple Store can reset your phone after verifying your identity.
  • If you set up Find My iPhone before you got locked out, you can use it to erase the phone remotely and remove the passcode.

Using iCloud to reset your passcode from another device

This method works if you have a computer, tablet, or another phone nearby and you remember your Apple ID email and password. Open a web browser and go to iCloud.com. Sign in with your Apple ID — the same one you use on your iPhone.

Once you are signed in, click Find My (or Find My iPhone if you are on an older iCloud interface). A map will appear showing your devices. Click on your iPhone in the list on the left side. A panel will open on the right showing options. Click Erase iPhone. Confirm that you want to erase it. The phone will begin erasing within a few minutes, and the passcode will be removed in the process.

After the erase is complete, your iPhone will show the setup screen. You can set a new passcode at that point. If you have a backup saved to iCloud, you can restore your photos, messages, and other data during setup by signing in with your Apple ID and choosing Restore from iCloud Backup.

Resetting through a computer with a USB cable

If you have a Mac or Windows computer and a USB cable that fits your iPhone, you can use Apple's Finder (on Mac) or iTunes (on Windows) to reset the phone. This method does not require you to remember your Apple ID password, but it does erase the phone completely.

Plug your iPhone into the computer with the USB cable. On a Mac running macOS Monterey or newer, open Finder and look for your iPhone in the sidebar. On an older Mac or any Windows computer, open iTunes. Your iPhone should appear in the window. Click on it to select it.

Look for a button that says Restore or Restore iPhone. Click it. A dialog will ask if you want to restore — this will erase the phone and remove the passcode. Confirm. The computer will download the latest iPhone software and install it on the phone. This can take 15 to 30 minutes depending on your internet speed and which iPhone model you have. When it finishes, your iPhone will restart and show the setup screen. You can then create a new passcode and restore from a backup if you have one.

Getting help at an Apple Store

If you don't have access to another device or a computer, or if the methods above don't work for your situation, an Apple Store can reset your iPhone. You will need to prove you own the phone. Bring a photo ID and any proof of purchase you have — a receipt, an order confirmation email, or your Apple ID account page showing the device.

Visit Apple.com/retail to find the nearest Apple Store and book a Genius Bar appointment. Walk-ins are sometimes possible but appointments are faster. Tell them you are locked out of your iPhone. They will verify your identity and ownership, then reset the phone for you. This usually takes 30 minutes to an hour. After the reset, you can set up the phone again and restore from a backup.

If you don't have an Apple Store nearby, look for an authorized Apple service provider in your area. These are independent repair shops that Apple has certified. They can often do the same reset, though wait times and policies vary by location.

What happens if you don't have a backup

All three reset methods — iCloud, computer, or Apple Store — erase your iPhone completely. If you don't have a backup saved to iCloud or to a computer, you will lose your photos, messages, contacts, and any other data stored on the phone. There is no way to recover that data after the erase is complete.

To avoid this in the future, turn on iCloud Backup. Go to Settings, tap your name at the top, tap iCloud, then tap iCloud Backup. Turn it on. Your iPhone will back up automatically when it is plugged in, connected to Wi-Fi, and locked. If you set this up before you get locked out, you can restore everything after you reset your passcode.

If you have a computer, you can also back up to it. On a Mac, open Finder, click your iPhone in the sidebar, and click Back Up Now. On Windows, open iTunes, click your iPhone, and click Back Up. These backups save to your computer's hard drive instead of to iCloud.

Preventing lockouts in the future

The best way to avoid being locked out is to write down your passcode and store it somewhere safe — not on your phone. A notebook in a drawer at home works. Do not use a password manager that is also on your iPhone, because you won't be able to access it if you are locked out.

Set up Face ID or Touch ID as a backup way to unlock your phone. Go to Settings, tap Face ID & Passcode (or Touch ID & Passcode), and follow the prompts. If you forget your passcode, you can still unlock the phone with your face or fingerprint. You can then change your passcode in Settings without needing to erase the phone.

Turn on Find My iPhone before you get locked out. Go to Settings, tap your name, tap Find My, then tap Find My iPhone and turn it on. This lets you erase your phone remotely from iCloud.com if you ever get locked out, without needing a computer or USB cable.

Frequently Asked Questions

Can I unlock my iPhone without erasing it?

No. If you forget your passcode and don't have Face ID or Touch ID set up, the only way to unlock the phone is to erase it. Apple designed it this way for security — to prevent someone else from accessing your data if they steal your phone. The erase removes the passcode, but it also removes everything else on the phone unless you restore from a backup.

What if I don't remember my Apple ID password either?

Go to iforgot.apple.com and enter your Apple ID email. Apple will send you a link to reset your password. You can use that new password to sign into iCloud.com and erase your iPhone. If you don't have access to the email address linked to your Apple ID, you will need to go to an Apple Store and bring proof of identity and ownership.

How long does it take to reset an iPhone?

Using iCloud takes a few minutes to start the erase, but the phone may take 15 to 30 minutes to fully erase and restart. Using a computer takes 15 to 30 minutes depending on your internet speed. At an Apple Store, the process usually takes 30 minutes to an hour, but you may wait longer if the store is busy.

Will resetting my iPhone delete my iCloud photos?

No. Your iCloud photos are stored in Apple's servers, not on your phone. Erasing your iPhone does not delete them. When you restore from your iCloud backup after the reset, your photos will come back to your phone automatically.

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

Yes, they can erase it remotely using iCloud.com. This is why it is important to use a strong, unique password for your Apple ID and to turn on two-factor authentication. Go to Settings, tap your name, tap Password & Security, and turn on two-factor authentication. This requires a code from one of your trusted devices when someone tries to sign in to your Apple ID from a new location.