Ten failed passcode attempts in a row trigger the Erase Data setting, which erases all information, media and personal settings on the iPhone instead of only locking it. The switch sits at the bottom of Settings > Face ID & Passcode (Touch ID & Passcode on an iPhone with Touch ID). With it off, wrong guesses still lock the iPhone, but they don’t wipe it.
Should Erase Data be on for you?
Apple’s passcode page in the iPhone User Guide describes the setting as a way to erase the iPhone after 10 consecutive failed passcode attempts, and adds that after all data is erased, you must restore the device from a backup. That makes it a trade-off between protection against guessing and the risk of an accidental wipe.
| Your situation | What to consider |
|---|---|
| Your iPhone holds sensitive data, it rarely leaves your hands, and it is backed up | Leaving Erase Data on adds protection if someone tries to guess the passcode. |
| A young child, or someone who doesn’t know the passcode, often picks up the phone | Ten wrong entries in a row are easier to reach than they sound. Turning Erase Data off avoids an accidental wipe; the passcode still protects the phone. |
| You have no recent backup | Back up first. An erased iPhone with no backup can’t get its data back. |
| You want fewer passcode prompts, not a different erase rule | That is a separate setting. See how the iPhone decides when to ask for the passcode. |
Turning Erase Data off is not the same as removing the passcode, and it doesn’t make the passcode easier to guess. If you are weighing whether to drop the passcode entirely, read what happens when the passcode is turned off first; for most people a stronger passcode is the better fix.
Turn Erase Data off or back on
You need to know the current passcode to open this screen.
- Open the Settings app.
- Tap Face ID & Passcode. On an iPhone with Touch ID, such as iPhone SE, tap Touch ID & Passcode.
- Enter your passcode.
- Scroll to the bottom of the screen and turn off Erase Data.

To turn it back on, return to the same screen and turn on Erase Data. If your iPhone shows a confirmation, read it and confirm.
The same Face ID & Passcode screen is where you go for changing your iPhone 14 passcode, so it is worth reviewing both at once. A longer code makes guessing far slower, and you can use letters in your passcode or, if you prefer a short code, switch to a 4-digit passcode knowing it is the weaker choice.
What happens after wrong passcodes
With or without Erase Data, the iPhone locks you out after several wrong passcodes in a row. Apple’s pages describe this slightly differently: the User Guide mentions a message that the iPhone is disabled, while Apple’s Passcode Reset article says an “[Device] Unavailable” screen appears after five incorrect attempts. Apple’s pages don’t say which wording applies to which iOS version, and Apple doesn’t publish wait times.
- Erase Data on: after 10 consecutive failed passcode attempts, the iPhone erases all information, media and personal settings.
- Erase Data off: the iPhone stays locked (Apple’s pages describe this as disabled or Unavailable). Your data stays on the phone, but if you can’t recall the passcode, Apple’s routes for a forgotten passcode still erase it (see the next sections).
In other words, turning Erase Data off protects against a wipe caused by someone else’s guesses. It doesn’t give you a way into the phone if you forget the passcode yourself.
If you can’t change the switch
- No passcode is set. Erase Data is one of the passcode options. If the screen shows Turn Passcode On, there is no passcode yet; set one first.
- Stolen Device Protection is on. Apple’s Stolen Device Protection page lists actions that need Face ID or Touch ID, and some that also need a one-hour Security Delay away from familiar locations, such as changing the passcode or using Reset All Settings. The Erase Data switch is not on that list, but if you plan to change the passcode at the same time, expect the delay. See how Stolen Device Protection works.
- A school or employer manages the iPhone. An organization that manages a device can control some of its settings. If the switch can’t be changed on a work or school iPhone, ask the person who manages it.
If you are already locked out
Apple’s order is: try Passcode Reset first, then reset the iPhone on the device itself, and use a computer only if that fails. Every route except Passcode Reset erases the iPhone.
You changed the passcode in the last 72 hours
Apple’s Passcode Reset gives you 72 hours during which you can still get into your iPhone with your previous passcode (iOS 17 and later). On the Unavailable screen, tap Forgot Passcode? and follow the prompts to use your previous passcode, then set a new one.
Reset the iPhone from the Lock Screen
Apple’s forgotten passcode page lists these conditions: iOS 15.2 or later, Find My turned on before the lockout, a cellular or Wi-Fi connection, and your Apple Account and password.
- Keep entering the passcode until the Unavailable screen appears.
- Tap Forgot Passcode?
- On the Security Lockout screen, tap Start iPhone Reset.
- Enter your Apple Account password to sign out of your Apple Account on the device.
- Tap Erase iPhone. When the iPhone restarts, set it up again, restore from a backup if you have one, and set a new passcode.
On iOS 15.2 or iOS 16, an Erase iPhone option appears on the lock screen instead of Forgot Passcode?, with the same conditions.
Use a computer
If the Lock Screen option isn’t available, Apple’s computer reset article covers it: turn off the iPhone, connect it to a Mac or Windows PC while holding the button for your model to enter recovery mode, then choose Restore in Finder on a Mac or in the Apple Devices app on Windows (under General). This also erases the iPhone. For the full erase process on an older model, see how to factory reset an iPhone 7.
Third-party passcode-removal tools are not covered here; the routes above are the ones Apple documents.
Erase Data setting questions
Will turning off Erase Data turn off my passcode?
No. The passcode and Erase Data are separate options on the same screen. Turning off Erase Data leaves the passcode, Face ID or Touch ID working as before.
Do I need my Apple Account password to reset a locked iPhone?
Yes. Apple’s Lock Screen reset asks for the Apple Account password to sign out before it erases the iPhone. Make sure you know it before you rely on that route.
Does the old passcode work after I change it?
On iOS 17 and later, for 72 hours. Apple calls this Passcode Reset, and it is meant for people who forget a passcode they just changed.
Is there a way back into a locked iPhone that keeps my data?
Only Passcode Reset, within that 72-hour window. Otherwise Apple’s routes erase the iPhone, and your data comes back only from a backup.
Before you change anything on this screen, make sure a recent backup exists.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.