Forgot Your iPhone Passcode? Reset It and Restore Your Data

If you forgot your iPhone passcode, first check whether you changed it within the last 72 hours: on iOS 17 or later, you may be able to unlock the phone with your previous passcode and set a new one without erasing anything. If that window has passed, or you never changed the code recently, Apple’s supported recovery options erase the iPhone. You can then restore a backup or recover items that were already synced to iCloud.

There isn’t a supported way to reveal or bypass a forgotten passcode. Before you erase the device, make sure you know the Apple Account password used with it. Find My can leave Activation Lock on after an erase, so that account may be needed during setup.

Try your previous passcode first

If you changed the passcode in the last 72 hours and haven’t expired the old one, Passcode Reset can unlock the phone without erasing it. It requires iOS 17 or later.

  1. On the Lock Screen, enter a wrong passcode until the “iPhone Unavailable” screen appears. After five incorrect attempts, the lockout screen can offer the reset option.
  2. Tap Forgot Passcode?, then choose Enter Previous Passcode.
  3. Enter the previous passcode and follow the prompts to set a new one. You’ll be asked to change it immediately.
An iPhone Unavailable Lock Screen with the Forgot Passcode option at the bottom.
iPhone Unavailable screen with the reset option.
The Passcode Reset screen with an Enter Previous Passcode option.
Use the previous passcode within its 72-hour window.

See Apple’s Passcode Reset instructions for the current requirements. If the option is missing, use one of the erase-and-restore methods below.

Erase the iPhone from its Lock Screen

This is usually the simplest reset if you have iOS 15.2 or later, Find My was turned on before you were locked out, the iPhone has Wi-Fi or cellular service, and you know your Apple Account password. In iOS 17 or later, the option is called Forgot Passcode?; iOS 15.2 and iOS 16 may show Erase iPhone.

  1. Enter passcodes until the unavailable or security-lockout screen appears, then tap Forgot Passcode? (or Erase iPhone on older supported versions).
  2. Tap Start iPhone Reset if prompted, enter your Apple Account password, and confirm that you want to erase the device.
  3. If offered an eSIM choice on iOS 17 or later, choose whether to keep the eSIM or erase it too. Keeping it preserves the cellular plan on the phone; deleting it may require your carrier to reactivate service.
  4. After the iPhone restarts, follow the setup assistant and restore from a backup if you have one.
The iPhone Security Lockout screen with a Start iPhone Reset button.
The reset confirmation warns that data will be erased.
An Erase This iPhone screen showing choices to keep or delete an eSIM.
Choose whether to keep the eSIM.

Apple lists the requirements in its forgotten-passcode reset guide. If the on-device option is unavailable, sign in to iCloud Find Devices, select the iPhone, and choose Erase This Device. If it’s offline, erasure starts when it reconnects. Activation Lock remains, so the Apple Account password is needed to reactivate it.

Use recovery mode with a Mac or PC

Use a computer if the Lock Screen reset is unavailable. You’ll need a Mac or Windows PC, a cable, and an internet connection. The restore process erases the phone. On a Mac, open Finder; on Windows, install and open Apple Devices. Apple’s computer reset guide includes model-specific directions.

  1. Turn off the iPhone. For a Face ID model, hold the side button and Volume Down until the power slider appears; for a Home-button model, hold the side or top button. Drag the slider.
  2. Connect the cable to the computer. Connect it to the iPhone while holding the correct button until the computer-and-cable recovery screen appears. Use the side button for Face ID models, iPhone 8 and iPhone SE (2nd/3rd generation); Volume Down for iPhone 7; or the Home button for iPhone 6s and earlier and iPhone SE (1st generation).
  3. On a Mac, select the iPhone under Finder’s Locations section. When offered Restore or Update, choose Restore.
An iPhone showing the computer-and-cable recovery symbol while connected by cable to a Mac.
Hold the correct button until recovery mode appears.
A Finder window with an iPhone selected under Locations and the Restore iPhone button.
Choose Restore in Finder on Mac.
  1. On Windows, select the iPhone in Apple Devices, open General, and choose Restore. Follow the prompts on either computer.
  2. If the software download takes more than 15 minutes and the iPhone leaves recovery mode, let the download finish, then turn off the phone and repeat the recovery-mode button sequence.
The Apple Devices app on Windows with an iPhone selected and the Restore action visible.
Choose Restore in Apple Devices on Windows.

Restore a backup and set a new passcode

At the Hello screen, continue setup to Transfer Your Apps & Data. Choose From iCloud Backup or From Mac or PC, sign in, and select a backup by date and size. Keep the phone on Wi-Fi and power; iCloud may continue downloading content after setup.

The iPhone Hello screen beside the Apps and Data setup screen with iCloud and computer backup choices.
Select a saved backup during iPhone setup.

A backup restores only data it captured. Items already synced through iCloud Photos or iCloud Drive can sync back after you sign in; unsynced data created after the last backup may be lost. Read Apple’s iCloud backup explanation and restore instructions. With no backup, set up the iPhone as new to recover content that was already synced. Choose a passcode you can remember.

Leave a Comment

iMessage Is Signed Out on iPhone: How to Fix It

iMessage Is Signed Out on iPhone: How to Fix It

Fix the iMessage Is Signed Out error on iPhone by checking Apple Account sign-in, activation, connectivity, and settings—without erasing your messages.

How to Turn Off VPN on iPhone (App and Settings)

How to Turn Off VPN on iPhone (App and Settings)

Turn off your iPhone VPN in the app or Settings, confirm it disconnected, and stop automatic reconnections without deleting your account.

How to Encrypt an iPhone and Protect Sensitive Information

How to Encrypt an iPhone and Protect Sensitive Information

Learn how to encrypt your iPhone with a strong passcode, protect iCloud and computer backups, and secure your data if your phone is lost or stolen.

How to Clear Cache on iPhone: Safari, Chrome, and Apps

How to Clear Cache on iPhone: Safari, Chrome, and Apps

Learn how to clear Safari and Chrome cache on iPhone, manage app storage safely, and understand when clearing cached data actually helps.

How to Fight Gym Battles in Pokémon GO: Attacks, Dodges, and Taking Control

How to Fight Gym Battles in Pokémon GO: Attacks, Dodges, and Taking Control

Learn how to fight Gym Battles in Pokémon GO, pick effective attackers, use Charged Attacks and dodges, and claim a Gym after defeating its defenders.

Best Cydia Tweaks and Apps for Your Jailbroken iPad: Classic Picks

Best Cydia Tweaks and Apps for Your Jailbroken iPad: Classic Picks

Explore classic Cydia tweaks for jailbroken iPads, from SwipeSelection to Quasar, with compatibility warnings and modern alternatives.

How to Turn Off the Apple Music Splash Screen on iPhone

How to Turn Off the Apple Music Splash Screen on iPhone

Stop Apple Music signup prompts in the Music app. Learn where to find Show Apple Music on iOS and what turning it off does—and does not—change.

Let Mom Know Your iPhone Battery Is Low With an Automatic Text

Let Mom Know Your iPhone Battery Is Low With an Automatic Text

Set up a Shortcuts automation to text Mom when your iPhone battery gets low. Follow four steps, plus delivery checks and privacy tips.

How to Bookmark a Tweet on X (Twitter) on Any Device

How to Bookmark a Tweet on X (Twitter) on Any Device

Save posts on X in a few taps. Learn where to find the Bookmark button on iPhone, Android, and desktop, plus how to view, remove, and organize saved tweets.

How to Enable AR Mode in Pokémon GO on iPhone or Android

How to Enable AR Mode in Pokémon GO on iPhone or Android

Turn on AR mode in Pokémon GO during a wild encounter, find AR settings, and fix camera or device compatibility issues.