If you've forgotten the passcode for your iPhone or iPad, you can erase and reset or restore the device using your Apple ID and password. This article explains how.

ios 13 iphone ipad duo
‌iPhone‌ passcodes are usually six digits long, but they can still be forgotten, especially if the device hasn't been used for a while. If you find yourself in this predicament, you have the option to erase and reset it, after which you can restore the contents from a backup.

If you enter the wrong passcode several times on an ‌iPhone‌ running an iOS version earlier than iOS 15.2, your ‌iPhone‌ will disable itself for a time and you'll need to connect it to a computer and restore it from a backup.

If the ‌iPhone‌ is running iOS 15.2 or later, you won't need to connect it to a Mac or PC to reset it. Instead, you'll get an option to erase it when it's in Security Lockout mode, and you'll be able to restore from an iCloud backup.

The series of steps below outline the actions you need to take in both cases.

How to Reset a Locked iPhone Running iOS 15.2

The following steps assume your ‌iPhone‌ or ‌iPad‌ is running iOS 15.2 or iPadOS 15.2 or later, and is connected to a cellular or Wi-Fi network. Note that if you restart your device when you see "Security Lockout" on the Lock Screen, you won't be able to reconnect to a Wi-Fi network until your device is unlocked.

  1. From your device's Lock Screen, try entering your passcode several times until it asks you to try again later. When you can, repeat this action until you see the Erase ‌iPhone‌/‌iPad‌ option in the bottom corner of the screen.
  2. Tap Erase iPhone/iPad, then tap Erase iPhone/iPad again to confirm.
    Lock Screen

  3. Enter your ‌Apple ID‌ password to sign out of your Apple account on the device.
  4. Tap Erase iPhone/iPad once again to permanently delete all of your data and settings.
  5. When the iOS device restarts, follow the onscreen instructions to set it up again, restore your data and settings from a backup, and set a new passcode.

How to Restore a Locked iPhone Running iOS 15.1 or Earlier

  1. First, put your ‌iPhone‌ into DFU recovery mode.
  2. Next, connect it to a PC or Mac using a Lightning cable.
  3. Select your ‌iPhone‌ in the Finder sidebar on Mac, or in iTunes on the PC that it's connected to.
  4. Choose Restore when you see the option to Restore or Update. If the download takes more than 15 minutes and your device exits the recovery mode screen, let the download finish, then turn off your ‌iPhone‌ and start again.
    recovery mode iphone finder

  5. Wait for the process to complete.
  6. Disconnect your ‌iPhone‌, then turn it on and set it up.

If you're planning on trading in an old ‌iPhone‌ for a new one, there are some steps you'll want to take beforehand to ensure it's de-linked from your accessories and accounts and that everything on it is erased.

Related Forum: iOS 15

Popular Stories

Apple Logo Spotlight

Report: Apple to Launch These New Products in 2026

Sunday November 2, 2025 5:34 am PST by
Apple is planning to launch at least 15 new products in 2026, according to Bloomberg's Mark Gurman. Gurman outlined what to expect from Apple in 2026 in the latest edition of his "Power On" newsletter. He said the company is heading "into one of its most pivotal years in recent memory," with the rollout of major new Apple Intelligence features, intense regulatory pressure on the App Store,...
iOS 26

Apple Releases iOS 26.1 With Liquid Glass Toggle, Slide to Stop Alarm, New Apple Intelligence Languages and More

Monday November 3, 2025 1:11 pm PST by
Apple today released iOS 26.1, the first major update to the iOS 26 operating system that came out in September, iOS 26.1 comes over a month after iOS 26 launched. ‌iOS 26‌.1 is compatible with the ‌iPhone‌ 11 series and later, as well as the second-generation ‌iPhone‌ SE. The new software can be downloaded on eligible iPhones over-the-air by going to Settings > General >...
iOS 26

iOS 26.1 Available Now With These 8 New Features

Monday November 3, 2025 5:54 am PST by
Following more than a month of beta testing, Apple released iOS 26.1 on Monday, November 3. The update includes a handful of new features and changes, including the ability to adjust the look of Liquid Glass and more. Below, we outline iOS 26.1's key new features. Liquid Glass Toggle iOS 26.1 lets you choose your preferred look for Liquid Glass. In the Settings app, under Display...
Early Black Friday Deals 2

The Best Early Black Friday Apple Deals

Sunday November 2, 2025 10:04 am PST by
We're officially in the month of Black Friday, which will take place on Friday, November 28 in 2025. As always, this will be the best time of the year to shop for great deals, including popular Apple products like AirPods, iPad, Apple Watch, and more. In this article, the majority of the discounts will be found on Amazon. Note: MacRumors is an affiliate partner with some of these vendors. When ...
Apple Intelligence General Feature 2

New Version of Siri to 'Lean' on Google Gemini

Sunday November 2, 2025 6:06 am PST by
In his "Power On" newsletter, Bloomberg's Mark Gurman today provided an update on the status of Apple Intelligence and the plans for it in 2026. Apple is still planning to roll out its revamped version of Siri around March of next year. The release should be accompanied by the release of a new smart home display product with speaker-base and wall-mount options. A new Apple TV and HomePod...
Finder Siri Feature

Apple's New Siri Will Be Powered By Google Gemini

Wednesday November 5, 2025 11:57 am PST by
The smarter, more capable version of Siri that Apple is developing will be powered by Google Gemini, reports Bloomberg. Apple will pay Google approximately $1 billion per year for a 1.2 trillion parameter artificial intelligence model that was developed by Google. For context, parameters are a measure of how a model understands and responds to queries. More parameters generally means more...
HomePod mini and Apple TV

New Apple TV and HomePod Mini Likely Launching Soon

Sunday November 2, 2025 5:49 am PST by
A new Apple TV and HomePod mini could launch as soon as this month, Bloomberg's Mark Gurman today suggested. In today's "Power On" newsletter, Gurman said that Apple retail stores are planning an overnight refresh on the evening of November 11, where changes will be made after closing, such as refreshing displays and placing new products for the following day. The timing of the overnight...