iPhone has a security setting that automatically erases all data after 10 failed passcode attempts. It protects your information if your phone is lost or stolen, but it can also wipe your phone if a child or someone else keeps guessing the code. This guide explains how the setting works, how to turn it on or off, what happens at each failed attempt, and how to make sure you won’t lose data.
Quick Answer
Go to Settings > Face ID & Passcode (or Touch ID & Passcode), enter your passcode, scroll to the bottom and turn Erase Data on or off. When it’s on, the iPhone erases everything after 10 consecutive wrong passcodes.

Turn Erase Data On or Off
- Open Settings.
- Tap Face ID & Passcode or Touch ID & Passcode and enter your passcode.
- Scroll to the bottom.
- Switch Erase Data on (green) or off. Tap Enable to confirm when turning it on.
A passcode must be set to use this feature.
What Happens After Failed Attempts
With or without Erase Data, iPhone adds delays after repeated wrong passcodes:
| Failed attempts | What happens |
|---|---|
| 1–5 | You can try again right away |
| 6 | iPhone Unavailable, try again in 1 minute |
| 7 | Try again in 5 minutes |
| 8 | Try again in 15 minutes |
| 9 | Try again in 1 hour (timing can vary by iOS version) |
| 10 | With Erase Data on: iPhone erases all data. With it off: Security Lockout, and you must erase to regain access |
These delays make it very slow for anyone to guess a six-digit passcode, even without Erase Data.
Should You Turn It On?
- Turn it on if you carry sensitive information and back up regularly. It adds protection against someone guessing your passcode.
- Leave it off if children play with your phone, or if you don’t have a recent backup.
Other protections such as a strong passcode, Stolen Device Protection and Find My already make unauthorized access difficult.
Protect Your Data Before Enabling It
- Turn on iCloud Backup (Settings > your name > iCloud > iCloud Backup) or back up to a computer regularly.
- Turn on iCloud Photos, Contacts and Messages in iCloud so key data syncs.
- Make sure you know your Apple Account password; you’ll need it to restore and to pass Activation Lock after an erase.
If Your iPhone Was Erased
- Set it up again and choose Restore from iCloud Backup or restore from a computer backup.
- Sign in with your Apple Account to remove Activation Lock.
Frequently Asked Questions
Can someone erase my iPhone on purpose by entering wrong codes?
Yes, if Erase Data is on. That’s why it’s best for people who back up and keep their phone secure.
Does Erase Data affect Face ID or Touch ID attempts?
No. It counts wrong passcode entries only. Failed Face ID or Touch ID attempts eventually require the passcode instead.
Is there an Erase Data setting on iPad?
Yes, in the same place.
Summary
- Settings > Face ID (or Touch ID) & Passcode.
- Scroll down and toggle Erase Data.
- After 10 wrong passcodes, the iPhone erases itself.
- Keep backups if you turn it on.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.