A factory reset can bring a locked iPhone back to new use. It deletes all contacts, photos, videos, accounts, and messages on the device. While this is something most people try to avoid, it’s also a very useful function — especially when you want to sell your locked iPhone or erase your private information completely.
Sometimes, you may forget your passcode and can’t use the phone, or accidentally buy a locked iPhone.
In this guide, we’ll show you how to factory reset a locked iPhone, no matter whether it’s security locked, activation locked, or MDM locked.
Feel free to use the Table of Contents to jump directly to the situation that applies to you.
What Caused a Locked iPhone
Different types of lockouts require different factory reset methods. Let’s start by understanding why an iPhone gets locked in the first place.
There are two common causes:
Security Lockout
A Security Lockout happens when you enter the wrong passcode too many times. If you enter an incorrect passcode five times or more, the iPhone will display an option to reset your device. However, if you enter the wrong passcode ten consecutive times, the device will disable itself completely, and the only way to unlock it is through a factory reset. This feature is designed to protect your data from unauthorized access.

Activation Lock or MDM Lock
Activation Lock is one of Apple’s security features that prevents unauthorized use of a device if it’s lost or stolen. When you see the “Locked to Owner” screen, it means the phone may have been reset before. However, if Find My iPhone was not turned off, the device will remain linked to the owner’s Apple ID even after the reset, and this screen will appear. It can only be unlocked by entering the correct Apple ID credentials.
MDM Lock is a specific type of Activation Lock that is linked to an organization rather than a personal Apple ID. Only the administrator can enable or remove this lock.

Part 1. How to Factory Reset a Security Locked iPhone - 3 Methods
Option 1. Factory Reset a Locked iPhone Using a Computer (Ultimate Method)
What you need:
A USB cable
A Mac with Finder or a Windows PC with Apple Devices installed
Apple ID credentials (only required if Find My iPhone is turned on)
How to do it:
Step 1. Turn off your phone.
Step 2. Open Finder on Mac or Apple Devices on Windows. (Download them first if not installed.)
Step 3. Connect your iPhone to the computer using a cable. Then quickly continue to Step 4.
Step 4. Enter Recovery Mode on your iPhone. Press and hold the following buttons depending on your model until an image of a computer and a cable appears on iPhone's screen (not the Apple logo).
- iPhone X, iPhone SE (2nd or 3rd), iPhone 8, iPhone 8 Plus, or later:Side button
- iPhone 7 / 7 Plus:Volume Down button
- iPhone 6s, iPhone SE (1st gen), or earlier:Home button

Step 5. Perform the factory reset on your computer.

On Mac (Finder)
In Finder, select your iPhone in the sidebar under Locations.
If prompted, select Trust [your device].
You’ll see the option to Restore or Update your device. Choose Restore.
The computer will install the latest iOS version after you finish the on-screen insturctions.
On Windows (Apple Devices)
In Apple Devices, select your locked iPhone from the sidebar.
If needed, select Trust [your device], then go to General.
Select Restore
The computer will install the latest iOS version after you finish the on-screen insturctions.
Step 6. Once the reset is complete, the Hello screen will appear. The passcode has been removed, and you can now access the phone without entering a passcode.
Why This is The Ultimate Method
Works even when your iPhone isn’t connected to the internet.
In certain situations, you can get into the phone without entering your Apple ID. However, if Find My iPhone is turned on, the phone will still ask for the Apple ID credentials after reset. This is Activation Lock.
Compatible with all iOS versions.
Option 2. Factory Reset a Locked iPhone by Signing out of Apple ID

What you need:
The “iPhone Unavailable” screen must appear, which happens after 5 incorrect passcode attempts.
The device must be running iOS 15.2 or later.
An active cellular or Wi-Fi connection.
Find My previously enabled on the device.
How to do it:
Step 1. Tap Forgot Passcode or Erase iPhone in the bottom-right corner.
Tips: In some cases, you might be able to unlock your phone using your old passcode after this step. The device will guide you through the process or you can learn more from Apple's support page about Passcode Reset.
Step 2. If needed, tap Start iPhone Reset (or Erase iPhone again) to enter the "Sign out of Apple Account" screen.
Step 3. Enter your Apple account and password and tap done.
Step 4. Now the process of factory resetting your iPhone will begin. And when finished, the Hello screen will appear.
Option 3: Erase the Locked iPhone from iCloud to Reset it
If the previous methods don’t work, you can try erasing the iPhone via iCloud.
Step 1. Go to icloud.com/find, and sign in with your Apple ID.
Step 2. In the list of devices, select the security locked iPhone you want to reset.
Step 3. Click Erase This Device (not Remove This Device).
Step 4. Follow the on-screen instructions.
Step 5. Make sure the locked iPhone is connected to a network so that the erase process can begin.
Step 6. On the iPhone, log in with the Apple ID credentials. Then follow the setup process, and you can access the phone without entering the previous passcode.
After factory resetting using this method, the iPhone will look like a brand-new device, but it will actually still be linked to your iCloud account. You can still locate it or play a sound if needed. This link will remain active unless you remove the device from your iCloud account or turn off Find My in the phone’s settings.
Part 2. How to Factory Reset an Activation Locked iPhone
If you know or can recover the Apple ID
If you know the Apple ID linked to the iPhone, or can recover it, the best way is to unlock the phone with that Apple ID first, and then go to Settings > General > Transfer or Reset iPhone > Erase All Content and Settings to perform a factory reset.
If you forget your Apple ID, try to recover it on iforgot.apple.com.
If you bought a second-hand iPhone
Sometimes it’s hard to know the Apple ID credentials, especially if you bought the phone from someone else. In this case, there are two things you can try to factory reset the phone and remove the lock:
Try to request additional support for unlocking your device. You’ll need to provide proof of purchase (like a receipt). Apple recommends keeping your purchase record safe for this reason. Once Apple unlocks it, the phone will be factory reset automatically.
Contact the previous owner. Ask them to go to iCloud.com/find and remove this device from their account. After that, you can set up and reset the iPhone normally.
Notes
Never buy a second-hand iPhone or iPad if it shows the Activation Lock screen.
You may need the seller’s help to remove the lock or perform the reset.
If you want to erase a lost or stolen iPhone remotely
If your iPhone was lost or given away and you’re worried about your privacy, go to iCloud.com/find, locate your device, and select Erase This Device. This will delete all your data remotely and protect your privacy.
Bonus Tip: How to Restore the Factory Reset iPhone Without Backup
After a factory reset, everything on that iPhone photos, messages, contacts, notes, is erased. Normally, you can only restore your data if you’ve made an iCloud or iTunes backup.
But what if you didn’t back up before the reset? Or your phone was locked and you couldn’t perform a backup at all?
That’s where Gbyte Recovery comes in. And it’s now free to preview what can be recovered with just a few clicks.
What is Gbyte Recovery
Gbyte Recovery is a professional iPhone data recovery tool that can access and recover data even when you don’t have a manual backup.
Unlike Apple’s built-in restore options that require a full reset, Gbyte lets you view and extract data directly from iCloud or device storage without erasing your current phone.
If you already have an iCloud or iTunes backup, Gbyte also allows you to see what’s inside your backup before restoring it — no need to wipe your working phone just to check your data.
What Can Gbyte Recovery Retrieve
📩 Text messages, contacts, and voice memos
🖼️ Photos and videos, even previously deleted ones
📂 Files and attachments stored on your device
💬 Chats from popular apps like WhatsApp, Teams, Instagram, Messenger, and more
How to Use Gbyte Recovery
Step 1. Download the PC version of Gbyte Recovery, or open the web app.
Step 2. Select the data types you want to scan. For the most complete results, choose All Data Types.

Step 3. Log in with your Apple ID.
Step 4. Wait for the scan to complete. Gbyte Recovery will analyze all your iCloud snapshots and backups, including old or deleted ones to locate recoverable data.

Step 5. Once the scan completes, you’ll get an on-screen notification (or a confirmation email if using mobile).
Step 6. Preview the data found in your iCloud account, including contents inside your iCloud backups. Choose what you want to recover, then click Restore to PC or Restore to Phone.

Knowledge Tip: Apple only keeps one latest iCloud backup per device — every new backup overwrites the previous one. Gbyte Recovery can retrieve those older, hidden backups that Apple’s interface no longer shows, giving you another chance to find your lost data.
Conclusion
Factory resetting a locked iPhone can be tricky, especially if you’ve forgotten the passcode or bought a secondhand device that’s still linked to the previous owner.
In this guide, we’ve explored how to factory reset a locked iPhone in different situations, whether it’s passcode-locked or activation-locked.
And if you’ve already performed a factory reset and lost your important data, Gbyte Recovery provides a safe and effective way to restore your iPhone data even without backup.
FAQs
Can I reset a locked iPhone using an iTunes backup?
No, you can’t. Restoring from an iTunes backup still requires your iPhone passcode.
If your phone is locked because you forgot the passcode, this method is not practical — iTunes won’t let you reset or restore the device without unlocking it first.
Can I hard reset my iPhone by pressing some buttons?
No, you can’t. There's only button combination to perform a force restart, not a factory reset.
Apple doesn’t allow you to factory reset an iPhone just by pressing buttons. To factory reset a locked iPhone, you’ll need to use computer, iCloud, or the “iPhone Unavailable” screen feature.