Can I factory reset my iPhone if I forgot my passcode?

Having a forgotten passcode on your iPhone can be incredibly frustrating. Without being able to unlock your phone, you can’t access any of your apps, photos, contacts, or anything else on the device. When you’ve tried too many incorrect passcode attempts and gotten locked out, a factory reset may seem like your only option to regain access to your iPhone.

What happens when you forget your iPhone passcode?

Newer iPhone models such as the iPhone XR, XS, 11, 12, and 13 are designed to protect your privacy and security. If someone tries to randomly guess your passcode, these models will disable touch input after 10 failed attempts. After 5 more failed attempts, the device will require you to connect it to a computer you’ve previously synced with or erase the device entirely.

Older iPhone models like the iPhone 5s through iPhone 8 Plus will disable touch input for 1 minute after 6 failed passcode attempts. You’ll see a message on the lock screen saying “iPhone is disabled. Try again in 1 minute.” If you keep entering wrong passcodes, the timeout gets progressively longer up to a maximum of 1 hour.

This timeout period is designed to prevent someone from brute forcing your passcode through endless guessing. The longer lockout time allows you to calm down and carefully recall your actual passcode if you repeatedly entered the wrong one. But if you’re sure you don’t remember the right passcode, the failed attempts counter still runs in the background.

Failed passcode attempt limits

After a certain number of failed passcode attempts, your iPhone initiates a full device erase:

  • iPhone 8 and earlier: After 10 failed passcode attempts
  • iPhone X and later: After 15 failed passcode attempts

Once this limit is reached, you’ll see a message saying that your iPhone data will be erased after one more failed passcode attempt. This prevents unlimited guessing of your passcode. The next failed passcode entry will perform a factory reset and delete all data on your iPhone.

What does a factory reset do?

A factory reset, also known as a device restore, erases all data and settings on your iPhone. It returns the device to its original out-of-the-box state. This includes:

  • Removing all apps, photos, music, and other media
  • Deleting contacts, calendars, notes, messages
  • Resetting all system settings to default
  • Updating to latest iOS version

After the reset completes, your iPhone will boot up and show the Hello screen just like when you first bought it. You’ll have to go through the setup process again to personalize it with your Apple ID, Wi-Fi network, and other settings.

What data can be recovered after a factory reset?

Any data that was only stored locally on your iPhone is erased and unrecoverable after a factory reset. This includes:

  • Photos
  • Messages
  • Notes
  • Voice memos
  • App data

However, some types of data can be restored from an iCloud or iTunes backup after the reset:

  • Contacts
  • Calendars
  • Safari bookmarks
  • Health data
  • Keychain passwords and credentials

If you have an iCloud backup that was saved before you forgot your passcode, you can use it to restore your data during iPhone setup. Or you can connect to a computer you’ve synced with previously and select a backup to restore locally.

Should I factory reset my iPhone if I forgot the passcode?

Resetting your iPhone after too many failed passcode attempts is inevitable. The device will force a factory reset once the failed passcode limit is reached. But before you get to that point, consider these options that could potentially avoid data loss from a reset:

Keep trying to recall your passcode

If you just forgot your passcode, keep calmly trying to remember it before you reach the 10 or 15 attempt limit. Passcodes we create are often patterns we’re familiar with. Retrace your steps of what you were doing when you last set or changed your passcode. That context can often jog your memory. If possible, wait a while before trying again so you can think clearly.

Use password manager hints

If you used a password manager like 1Password to generate and fill your iPhone passcode, there may be hints available in the app that could remind you of the passcode. Try signing into the password manager app or service from another device if you can’t launch the app on your locked iPhone.

Ask Siri for hints

If you have Siri enabled, you can ask Siri questions like “what’s my passcode?” or “when did I last change my passcode?”. Siri can remind you of passcode changes you’ve made through Settings in the past, which might help you remember.

Check notification center on Apple Watch

If you have an Apple Watch paired to your iPhone, swipe up on the watch screen to view notifications. If you’ve received any emails, texts, or alerts containing numbers recently, they may be your forgotten passcode.

Try Touch ID or Face ID

If you’re using an iPhone model with Touch ID or Face ID, you may be able to unlock your phone without entering your passcode. Place your finger on the Home button or look at the front camera. This will only work if you haven’t manually disabled biometric authentication.

Enter your Apple ID password

As a last resort before your iPhone is disabled or reset, try entering your Apple ID account password instead of your passcode at the lock screen. This trick sometimes works to unlock the device temporarily so you can access settings or data.

How to factory reset an iPhone if you forgot your passcode

If you can’t remember your passcode and have exhausted all other options, factory resetting your iPhone through recovery mode is the only choice left. This will erase and restore your device to factory settings.

Requirements

  • Computer with iTunes installed (Windows or Mac)
  • USB to Lightning cable
  • Locked iPhone
  • 5-10 minutes

Instructions

  1. Connect your iPhone to the computer using a USB cable. Do not disconnect until the process completes.
  2. Open iTunes on your computer. A popup may ask “Do you want to allow this computer to access information on your iPhone?” Click Cancel.
  3. Hold down the Sleep/Wake and Home buttons on your iPhone simultaneously until you see the connect to iTunes screen.
  4. Continue holding just the Home button until you see the recovery mode screen with an arrow pointing to iTunes logo.
  5. In iTunes, a recovery mode alert will appear saying your iPhone needs to be updated or restored. Click Restore.
  6. iTunes will download software for your device and begin the factory restore process. Wait for this to complete.
  7. The iPhone home screen will appear when finished. You can unplug from computer and setup as new iPhone.

This factory reset process will remove your forgotten passcode and erase all data on the iPhone. When it’s done, you’ll be able to set a new passcode to re-secure your device.

How to avoid forgetting your iPhone passcode

Resetting your iPhone due to a forgotten passcode causes massive headaches. Avoid finding yourself in this situation by taking proactive measures:

  • Use a password manager to generate and store a secure, random passcode.
  • Write down or store the passcode somewhere safe in case you forget it.
  • Enable Touch ID or Face ID for alternative unlock methods.
  • Create an Apple ID password hint to help remember your main password.
  • Set up an Apple Watch to view notifications with passcode hints.
  • Change your passcode periodically so you stay familiar with it.

Make your passcode easy to recall

Using an arbitrarily complex passcode you’ll never remember is unsafe. Opt for a 6-digit passcode based on numbers you’ll easily recall, like:

  • A birthday (030495)
  • Anniversary date (081520)
  • Random pattern (258093)

Avoid basing your passcode on easy patterns like 123456. But have it be something you can mentally recite when needed.

Store a hint to your passcode

It’s smart to have a secondary reminder or hint for your iPhone passcode. Some secure ways to do this include:

  • Password manager notes
  • Hidden note in iPhone or Mac Notes app
  • Written down in a secure location
  • Trusted friend or family member knows

Just make sure your passcode hint is vague enough that it can’t be guessed. And only store or share it in very secure places.

Reset iPhone without losing data

If you’re selling, exchanging, or giving away your iPhone, you’ll want to factory reset it to wipe your personal data. But avoid losing your photos, messages, and other important data.

Instead of erasing content with a reset, manually backup your iPhone first. Then when you do the reset, retain a copy of your data.

Back up iPhone before resetting

Your iPhone offers a few backup options:

  • iCloud backup – Automatically saves iOS device data like settings, photos, and app data to iCloud.
  • iTunes backup – Manually backup phone contents locally to a computer through iTunes.

Enable and run iCloud backups regularly so you have recent data snapshots. Or connect to iTunes on a trusted computer and run manual backups occasionally.

Restore iPhone data after resetting

After factory resetting your iPhone, walk through the initial setup prompts until you reach the Apps & Data screen. Here you can tap Restore from iCloud Backup or Restore from iTunes Backup to retrieve your data.

Sign into iCloud and select your latest backup. Or open iTunes, connect your iPhone, and choose the backup you want to restore from. This will return your device data while still ensuring it’s been wiped clean.

Conclusion

Accidentally forgetting your iPhone passcode can happen to anyone. But now you know how to factory reset your device even with a forgotten passcode. You also have some pro tips to avoid finding yourself in this frustrating predicament.

Be sure to regularly backup your iPhone data either to iCloud or locally through iTunes. That will let you safely reset the device without losing photos, messages, contacts, and other important data. With proper backups, you can erase your iPhone freely without worry when selling, exchanging or troubleshooting.