
To make your iPhone wipe itself after 10 wrong passcode entries in a row, open Settings > Face ID & Passcode (or Touch ID & Passcode), enter your passcode, scroll to the bottom and turn on Erase Data. It takes under a minute. Before you flip that switch, make sure you have a recent backup, because once the iPhone erases itself, a backup is the only way to get your photos, messages and settings back.
These instructions are for iOS 27, the current iPhone software. Apple has kept Erase Data in the same passcode settings screen for many releases, so the steps look nearly identical on recent older versions.
What Erase Data actually does
Erase Data is an optional security setting that is off by default. When it is on and someone enters the wrong passcode 10 times in a row, the iPhone removes all content and settings from its storage. Apple describes the result as erasing all information, media and personal settings, the same end state as a factory reset.
A few details matter before you decide:
- Only passcode attempts count. A failed Face ID or Touch ID scan is not a passcode attempt. After five failed scans, the iPhone simply asks for the passcode instead.
- The attempts must be consecutive. Unlocking successfully starts the count over. Apple also notes that typing the same wrong passcode again does not add to the total.
- The iPhone slows down guessing. After a few wrong entries, the Lock Screen makes you wait before you can try again, and the wait grows longer with each miss. This makes it hard for a curious child to reach 10 in a few seconds, though not impossible over a long afternoon.
- iCloud data is not touched. Anything already synced to iCloud, such as iCloud Photos or Contacts, stays in your account. Only the copy on the phone is erased.
Apple explains these rules in its Platform Security page on passcodes.
Back up first (do not skip this)
If the iPhone erases itself and you have no backup, Apple’s guide says you will have to set it up again as a new phone. Whatever was only on the device is gone.
The quickest check is Settings > [your name] > iCloud > iCloud Backup. Make sure Back Up This iPhone is on and look at the time of the last backup. If it is old, tap Back Up Now while connected to Wi-Fi. You can also back up to a Mac or Windows PC with a cable. Apple covers both routes in Back up iPhone, and you can follow the walkthrough on backing up an iPhone to iCloud or a computer if you have never done it.

Also make sure you know your passcode by heart. If you changed it recently, use the new one for a few days before turning on Erase Data. If you still need to pick a new one, changing the passcode on an iPhone 13 takes a minute in Face ID & Passcode.
Turn on Erase Data in iOS 27
- Open the Settings app.
- Tap Face ID & Passcode. On iPhone SE or iPhone Duo, which use Touch ID, tap Touch ID & Passcode instead.

- Enter your passcode. The passcode settings screen opens.
- Scroll all the way to the bottom. You will see the Erase Data switch, with a note below it about erasing the iPhone after 10 failed passcode attempts.
- Tap the switch so it turns green. If a confirmation message appears, tap Enable.

Nothing else changes right away. Face ID, Touch ID and your passcode keep working exactly as before.
If you have no passcode yet, Erase Data does not appear. Tap Turn Passcode On on the same screen first. Apple’s Set a passcode on iPhone page shows both steps, and Passcode Options there lets you pick a longer custom code.
When the switch is missing or gray
- Work or school phone: An iPhone managed by an employer or school through device management can have this setting controlled by the organization. It can even be set to erase after fewer than 10 attempts. Ask your IT team before changing anything.
- Screen Time limits: If someone set Screen Time restrictions that block passcode changes, the passcode settings may be locked. The Screen Time passcode holder can lift them.
- No passcode: As noted above, the option only shows up after a passcode is set.
How to confirm it is on, and how to turn it off
Go back to Settings > Face ID & Passcode (or Touch ID & Passcode), enter your passcode and scroll down. A green Erase Data switch means it is active. Please do not test it by typing wrong passcodes on purpose; that is how people lose their data.
To turn it off, return to the same screen and tap the switch so it turns gray. Consider doing this when you lend your phone to a child, or before handing it to a repair shop.
If the iPhone erases itself or you are locked out
After an automatic erase, the iPhone starts up like a new device. During setup you can restore your data from a backup; the steps for restoring an iPhone from iCloud Backup walk through that screen. If Find My was on, Activation Lock still protects the phone, so you will need your Apple Account email and password to finish setup. Apple explains this on its Activation Lock page.
If you forgot your passcode, stop entering guesses. The only safe route is Apple’s own process on its forgot your iPhone passcode support page. Avoid any app or website that promises to unlock an iPhone without erasing it; those tools can expose your data and your Apple Account.
Common questions about the 10-attempt erase
Is Erase Data worth turning on?
It suits people who back up daily and carry sensitive information, such as work email or health records. If young kids often play with your phone, or you tend to forget passcodes, the risk of an accidental wipe may outweigh the benefit.
Does Erase Data stop a thief from using my iPhone?
It protects the data, not the hardware. Activation Lock, which turns on with Find My, is what keeps a thief from setting the phone up for themselves. Stolen Device Protection adds extra checks when the phone is away from familiar places. Apple describes it in About Stolen Device Protection.
Can I change the number of attempts?
No. On a personal iPhone the limit is fixed at 10. Only an organization’s device management can set a lower number.
How is this different from erasing an iPhone myself?
Erase Data is automatic and only reacts to wrong passcodes. To wipe a phone on purpose before selling it, follow the steps for erasing an iPhone and signing out of your Apple Account, which includes signing out so the next owner is not blocked by Activation Lock.
Next step: check that your latest backup finished today, then turn on Erase Data while it is still fresh in your mind.
You must be logged in to post a comment.