How To Unlock an iPhone: A Step-by-Step Guide

Noah Walker

A close up of a cell phone on a table

Unlocking your iPhone can open up a world of possibilities, from using it with a different cell carrier to regaining access when you’ve forgotten your passcode. You can unlock your iPhone from a carrier by contacting them directly or using their online unlock portal, but you’ll need to meet certain requirements like having the device paid in full and waiting at least 60 days after purchase. If you’ve been locked out due to a forgotten passcode, don’t worry—there are several solutions available.

For carrier unlocks, check if your phone is already unlocked by going to Settings > General > About. If it’s not, contact your carrier or visit their unlock portal. AT&T customers, for example, can use their device unlock website if their phone meets all requirements. This allows your iPhone to work with any carrier worldwide, giving you more freedom when traveling or switching providers.

If you’re locked out of your iPhone because you forgot your passcode, you can restore your device using a computer or, in newer iOS versions, use your Apple ID to reset the device without a computer. Both methods will erase all data on your iPhone, so having a recent backup is important.

How To Unlock an iPhone: A Step-by-Step Guide

Unlocking your iPhone allows you to use it with different carriers, swap SIM cards freely, and enjoy greater flexibility, especially when traveling internationally. This guide explains how to unlock your iPhone safely and legally.


Types of iPhone Unlocking

  1. Carrier Unlock: Allows your iPhone to work with any carrier’s SIM card.
  2. Device Unlock (Passcode Unlock): Unlocking the screen if you forgot your passcode.
  3. iCloud Activation Lock Removal: For cases where the device is locked to an Apple ID (requires original owner’s credentials).

How to Unlock Your iPhone from a Carrier

Step 1: Check If Your iPhone Is Locked

  • Insert a SIM card from a different carrier.
  • If you see an error like “SIM Not Supported” or no service, your iPhone is locked.

Step 2: Contact Your Carrier

  • The most reliable and legal way to unlock your iPhone is through your carrier.
  • Visit your carrier’s website or call customer support to request an unlock.
  • Requirements may include:
    • Your account is in good standing.
    • The phone is fully paid off.
    • The device is not reported lost or stolen.

Step 3: Wait for Confirmation

  • Carriers typically take a few days to process unlock requests.
  • You’ll receive confirmation via email or SMS.

Step 4: Complete the Unlock on Your iPhone

  • Insert a SIM card from a different carrier.
  • Connect your iPhone to Wi-Fi or iTunes.
  • Restart your iPhone.
  • The device should now be unlocked and accept the new SIM.

How to Unlock Your iPhone Screen (Forgot Passcode)

If you forgot your iPhone passcode, you’ll need to erase the device to remove the passcode:

Step 1: Put Your iPhone in Recovery Mode

  • Connect your iPhone to a computer.
  • Follow the recovery mode steps based on your model:
    • iPhone 8 or later: Press and release Volume Up, then Volume Down, then hold Side button until recovery screen appears.
    • iPhone 7/7 Plus: Hold Volume Down + Side button.
    • iPhone 6s or earlier: Hold Home + Side button.

Step 2: Restore Your iPhone

  • Open Finder (macOS Catalina or later) or iTunes (Windows or older macOS).
  • Choose Restore when prompted.
  • This erases your iPhone and installs the latest iOS.

Step 3: Set Up Your iPhone

  • After restore, set up your iPhone.
  • If Activation Lock appears, enter your Apple ID credentials.

How to Remove iCloud Activation Lock

  • Only the original Apple ID owner can remove Activation Lock.
  • If you bought a second-hand iPhone that’s activation locked, contact the seller.
  • Apple Support cannot unlock devices without proof of purchase.

Important Tips & Warnings

  • Avoid third-party unlocking services that promise instant unlocks for a fee—they may be scams or illegal.
  • Always back up your data before unlocking or restoring your iPhone.
  • Unlocking your iPhone does not void Apple warranty if done through your carrier.

Summary

Unlocking your iPhone carrier-wise is best done through your service provider. For passcode issues, use recovery mode to reset your device. Activation Lock removal requires original Apple ID credentials. Follow these steps carefully to unlock your iPhone safely and legally.

Key Takeaways

  • iPhones can be unlocked from carriers if they meet requirements like being paid in full and 60+ days old.
  • Forgotten passcodes can be fixed by restoring your iPhone through a computer or using your Apple ID credentials.
  • Always check if your phone is actually locked before starting the unlock process by checking in your iPhone settings.

Understanding iPhone Locks and Security

Apple has built several layers of security into iPhones to protect personal data. These security features work together to keep your information safe while still making your device easy to use.

The Role of Apple ID and iCloud in iPhone Security

Your Apple ID is the key to your iPhone’s security system. This account links to all Apple services and helps protect your personal information.

When you set up an iPhone, it asks for your Apple ID and password. This connection lets you access iCloud services like photos, contacts, and backups.

iCloud adds extra protection by saving your data in the cloud. If your phone is lost, you can still get your information from another device.

Two-factor authentication makes your Apple ID even safer. When you sign in on a new device, you need both your password and a code sent to your trusted devices.

Always use a strong, unique password for your Apple ID. Don’t share it with others, as it controls access to your backups and personal data.

How Face ID and Touch ID Enhance Protection

Face ID and Touch ID make unlocking your iPhone quick while keeping it secure. These features let you use your face or fingerprint instead of typing a passcode.

Face ID works by scanning your face with tiny dots to create a detailed map. This technology is highly accurate and can recognize you even if you grow a beard or wear glasses.

Touch ID stores your fingerprint data in a special chip called the Secure Enclave. This information never leaves your device or gets sent to Apple.

Both systems learn over time. Face ID improves with each scan, while Touch ID gets better at recognizing your fingerprint with continued use.

These biometric systems help prevent others from accessing your phone. The chance of someone else’s fingerprint unlocking Touch ID is about 1 in 50,000.

Activation Lock and iCloud Activation Lock Explained

Activation Lock is a powerful anti-theft feature that turns on automatically when you set up Find My on your iPhone. It helps protect your device if it’s lost or stolen.

When Activation Lock is on, your Apple ID and password are required to:

  • Turn off Find My
  • Erase your iPhone
  • Reactivate and use your device

This makes stolen iPhones much less valuable to thieves since they can’t be reset and sold without your password.

If you see a Security Lockout message, it means someone has tried the wrong passcode too many times. This is a safety feature that protects your data from unauthorized access attempts.

Before selling or giving away your iPhone, always sign out of iCloud and turn off Find My. This removes Activation Lock so the new owner can set up the device.

Unlocking Your iPhone

Unlocking your iPhone can refer to bypassing a forgotten passcode or removing carrier restrictions. The methods vary depending on your specific situation and iPhone model.

Step-by-Step Guide to Unlock iPhone Passcode

If you’ve forgotten your iPhone passcode, don’t panic. You have several options to regain access to your device.

For a simple passcode reset, you can use your Apple ID credentials. Go to the passcode entry screen and keep entering incorrect passcodes until your iPhone is disabled. Then tap “Erase iPhone” at the bottom of the screen.

Another method is through the Settings app if you remember your passcode but want to change it. Go to Settings > Face ID & Passcode (or Touch ID & Passcode on older models). Enter your current passcode, scroll down, and tap Change Passcode.

If you forgot your passcode completely, you’ll need to erase your iPhone and restore from a backup. Make sure your data is backed up to iCloud or your computer before proceeding.

Remember that unlocking your iPhone will erase all data if you don’t have a backup.

Recovery Mode and Restoring via iTunes

Recovery mode is a powerful way to unlock your iPhone when other methods fail. This works well for severe software issues or forgotten passcodes.

To enter recovery mode:

  1. Connect your iPhone to a computer with iTunes installed
  2. Force restart your iPhone while connected:
    • For iPhone 8 or newer: Press and release Volume Up, press and release Volume Down, then press and hold Side button
    • For iPhone 7: Press and hold Side and Volume Down buttons
    • For iPhone 6s or earlier: Press and hold Home and Side buttons

Keep holding until you see the recovery mode screen (computer cable pointing to iTunes logo).

Once in recovery mode, iTunes will detect your device and offer to Restore it. Click this option to erase your iPhone and remove the passcode. Your iPhone will be reset to factory settings.

After restoring, you can set up your iPhone as new or restore from a backup.

How to Use Finder to Unlock an iPhone on macOS Catalina and Later

If you’re using a Mac with macOS Catalina or newer, iTunes has been replaced by Finder for iPhone management. The process is similar but takes place in a different app.

To unlock your iPhone using Finder:

  1. Connect your iPhone to your Mac with a cable
  2. Put your iPhone in recovery mode using the force restart method mentioned above
  3. Open a Finder window and look for your iPhone in the sidebar under “Locations”
  4. Click on your iPhone when it appears

You’ll see a dialog box with options to Update or Restore. Choose Restore to erase all content and settings, removing the passcode.

After the restoration process completes, you can set up your iPhone as new. If you have a backup in iCloud or on your Mac, you can restore your data during setup.

This method works on all iPhone models but requires a Mac running macOS Catalina or later.

Utilizing the ‘Find My iPhone’ Feature for Unlocking

The Find My iPhone feature offers a remote way to unlock your device without a computer nearby. This is especially useful when you’re away from home.

To use this method, you need access to another device and your Apple ID credentials. Visit icloud.com/find on any web browser or use the Find My app on another Apple device.

Sign in with your Apple ID and select your locked iPhone from the list of devices. Click Erase iPhone and confirm your choice. This will remotely wipe your device and remove the passcode.

After the erase process completes, your iPhone will restart as a new device. During setup, you can restore your data from an iCloud backup.

Remember that this method requires:

  • Your iPhone to be connected to the internet
  • Find My iPhone to be enabled before locking
  • Your Apple ID password

This approach works even when your iPhone is not physically with you.

SIM Unlock: Understanding Carrier Restrictions and Removal

SIM unlocking is different from passcode unlocking. It allows your iPhone to work with any carrier’s SIM card instead of just your original provider.

Many iPhones are “locked” to a specific carrier when purchased with a contract or payment plan. To check if your iPhone is locked, go to Settings > General > About and look for “Carrier Lock” or “No SIM restrictions”.

The official way to unlock your iPhone from carrier restrictions is to contact your carrier directly. Most carriers will unlock your iPhone if:

  • Your contract has ended
  • You’ve paid off your device
  • Your account is in good standing

Some third-party services like doctorSIM offer IMEI-based unlocking for a fee. These work by submitting your iPhone’s unique IMEI number to be whitelisted in Apple’s database.

There are also specialized unlock SIM cards that can bypass carrier restrictions on certain iPhone models.

Dealing with a Disabled or Unavailable iPhone

If you’ve entered the wrong passcode too many times, your iPhone may display “iPhone Unavailable” or “Security Lockout” messages. This can be stressful, but there are steps you can take to regain access without losing your data.

Steps to Take When iPhone Is Disabled or Says iPhone Unavailable

When your iPhone shows “iPhone Unavailable,” don’t panic. This happens after several incorrect passcode attempts. If you still see a timer, wait until it expires before trying again.

For newer iPhones, you’ll see the iPhone Unavailable message with no countdown timer after too many failed attempts. At this point, you have limited options to unlock your device.

The quickest solution is to:

  1. Turn off your iPhone completely
  2. Connect it to a computer
  3. Hold the side button while connecting
  4. Use iTunes or Finder to restore your device

If you have an iPhone backup, you can recover your data after the reset process. Without a backup, you’ll need to set up your iPhone as new.

Resetting iPhone when Wrong Passcode Is Entered Too Many Times

After too many incorrect attempts, your iPhone enters a security lockout. Here’s how to reset it:

For iPhones with Face ID:

  1. Press and hold the side button and either volume button
  2. Slide to power off when prompted
  3. Connect to computer while holding the side button
  4. Release when recovery mode appears

For older iPhones with Home button:

  1. Press and hold the side/top button
  2. Slide to power off
  3. Connect to computer while holding Home button
  4. Wait for recovery mode screen

You’ll need to restore your iPhone using iTunes or Finder. This will erase all content but allows you to regain access to your device.

Security Lockouts and Data Recovery Options

Apple’s security measures protect your data but can create challenges when you’re locked out. If your iPhone is disabled, there are a few recovery paths to consider.

If you’ve previously synced with iCloud, you can erase your iPhone remotely through Find My iPhone. This removes the passcode lock but also deletes all data.

Another option is recovery mode, which resets your iPhone to factory settings. Connect to iTunes or Finder, then follow the prompts to restore.

For those who regularly back up their devices, recovery is straightforward. After restoring, sign in with your Apple ID and restore from your backup. Without backups, all data will be permanently lost.

Apple Support might help in special cases if you can prove ownership of the device. Contact them with your purchase receipt or other proof.

Removing Apple ID and iCloud Account from an iPhone

Removing an Apple ID from your iPhone is essential when selling your device or fixing account issues. Apple’s security measures protect your data but can sometimes create obstacles when you need to remove previous account information.

Instructions to Remove Apple ID without Password

If you have access to the iPhone but don’t remember the password, you still have options. First, try the standard method by going to Settings, tapping on the owner’s name at the top, scrolling down and selecting “Sign Out.” You’ll need to enter the Apple ID password to complete this step.

If you’ve forgotten the password, you can reset it through Apple’s account recovery. Go to appleid.apple.com and click “Forgot Apple ID or password?” then follow the steps to reset your password.

For devices with two-factor authentication, you’ll need access to a trusted phone number or device. This ensures only you can reset the account.

Remember to back up any important data before removing an Apple ID, as you might lose access to purchases and content.

Erasing iPhone to Remove the iCloud Account

When you can’t access the previous Apple ID or password, erasing the iPhone completely is often necessary. This approach will remove the iCloud account along with all data on the device.

To erase your iPhone:

  1. Go to Settings > General > Reset (or Transfer or Reset iPhone in newer iOS)
  2. Select “Erase All Content and Settings”
  3. Confirm and wait for the process to complete

After erasing, the phone will restart as new. You can then set it up with your own Apple ID.

For remotely erasing a device, the previous owner can:

  1. Visit iCloud.com/find
  2. Sign in with their Apple ID
  3. Select the device
  4. Click “Erase iPhone”
  5. After erasing, click “Remove This Device”

This method helps properly transfer ownership and removes Activation Lock.

Using Third-Party Tools to Bypass Apple ID and iCloud Lock

When standard methods fail, third-party tools might help remove Apple ID restrictions. Tools like 4uKey and AnyUnlock claim to help bypass Apple ID locks without passwords.

These programs work by connecting your iPhone to a computer and running specialized software. The process typically involves:

  1. Installing the third-party tool on your computer
  2. Connecting your iPhone via USB cable
  3. Following the software’s prompts to remove the Apple ID

Some tools advertise an Unlock Apple ID feature that can remove Apple IDs without passwords. However, use these with caution.

Be aware that using third-party tools might void warranties or violate terms of service. Only use these methods on devices you legally own. Apple doesn’t endorse these tools, and their effectiveness varies with iOS versions.

Technical Solutions for Unlocking an iPhone

When you need to access a locked iPhone, several methods can help you regain control of your device without contacting your carrier. These approaches use different technologies to address both carrier locks and passcode issues.

Using iPhone Unlocker Tools like Dr.Fone – Screen Unlock

iPhone unlocker software provides a way to bypass lock screens when you’ve forgotten your passcode. Dr.Fone – Screen Unlock is one popular option that can remove various types of screen locks.

To use Dr.Fone, you’ll need to:

  • Download and install the program on your computer
  • Connect your iPhone via USB cable
  • Select the “Screen Unlock” feature
  • Follow the on-screen instructions to put your device in recovery mode

These tools work by forcing your device into a special mode that allows the removal of security features. However, using this method will erase all data on your iPhone.

Most unlocker tools require payment and may not work on the newest iOS versions. Before purchasing, check compatibility with your iPhone model and iOS version.

Employing IMEI Number for Unlocking Services

The IMEI (International Mobile Equipment Identity) number is a unique identifier for your iPhone that can help with carrier unlocking. This method works when you want to use your iPhone with a different carrier.

To find your IMEI number:

  1. Go to Settings > General > About
  2. Scroll down to locate the IMEI number
  3. Write it down for reference

With your IMEI, you can check if your iPhone is locked to a specific carrier. Third-party services can use this number to generate an unlock code.

These services typically require payment. For best results, choose reputable providers with positive reviews. Processing times vary from hours to several days depending on the service.

Considering System Repair and Lock Screen Passcode Solutions

When dealing with passcode issues, Apple offers built-in solutions to reset your device. The erase iPhone option removes all content including the passcode.

For locked screens, you can:

  • Use iTunes to restore your iPhone in recovery mode
  • Utilize the “Erase iPhone” feature through Find My iPhone
  • Access Emergency SOS if available on your model

System repair options don’t help with carrier unlocks. They only address passcode problems by resetting the device to factory settings.

Remember that the only official way to unlock an iPhone for use with any carrier is through your current carrier. Contact them first if your device is paid off and eligible for unlocking.

Advanced Unlocking Techniques and Considerations

iPhone unlocking goes beyond the basics of passcodes and Face ID. These advanced methods address specific scenarios where standard unlocking procedures aren’t enough, whether you’re dealing with management restrictions, carrier locks, or forgotten passcodes.

Understanding and Overcoming MDM Restrictions and Bypasses

Mobile Device Management (MDM) is used by businesses and schools to control iPhones remotely. These restrictions can limit apps, features, and settings on your device.

MDM restrictions can be challenging when you need full access to your iPhone. If you’ve purchased a used iPhone with MDM, you might face limitations you didn’t expect.

Legal MDM bypass options include:

  • Contacting the original organization that applied the MDM profile
  • Providing proof of purchase to Apple Support
  • Requesting official removal through proper channels

Warning: Unofficial MDM bypass tools promise to remove restrictions but may compromise your security or violate terms of service. These methods often don’t provide permanent solutions and may stop working after iOS updates.

Methods to Bypass iPhone Passcode and MDM

Forgotten your passcode? Apple offers official recovery methods that protect your data and security.

Official Passcode Recovery:

  1. Use Face ID or Touch ID if previously set up
  2. Try iTunes/Finder recovery mode on your computer
  3. Use Apple’s Recovery Assistant for newer iOS versions

For company-managed devices, talk to your IT department first. They can often help remove MDM restrictions properly.

Recovery mode will erase your phone, but your data stays safe if you have a backup. Always back up your iPhone regularly to prevent data loss during these procedures.

Carrier Unlocking Scenarios and IMEI Checkers

Carrier locks prevent using your iPhone with different service providers. Most carriers will unlock your iPhone if you meet certain requirements.

Steps for carrier unlocking:

  1. Check if your device is eligible (typically after contract completion)
  2. Contact your carrier directly through their customer service
  3. Provide your IMEI number (dial *#06# to find it)
  4. Wait for confirmation (usually takes 24-72 hours)

IMEI checkers help verify if your iPhone can be unlocked. These online tools check your device’s status before you start the process. Many sites offer free IMEI checks, but stick to reputable services to protect your information.

After receiving confirmation, complete the unlock by inserting a new SIM card and connecting to Wi-Fi or iTunes. Your iPhone should now work with any compatible carrier.

Preventative Measures and Maintenance

Keeping your iPhone secure requires regular attention to several key security practices. These habits not only prevent unwanted lockouts but also protect your personal data from unauthorized access.

Setting Strong Passcodes and Using Parental Controls

Creating a strong passcode is your first defense against unauthorized access to your iPhone. Avoid using simple patterns like 1234 or birth dates. Instead, use a mix of numbers that aren’t easily guessed.

Face ID and Touch ID add extra security layers while making daily access convenient. You can set up these features in your iPhone’s settings menu under Face ID & Passcode or Touch ID & Passcode.

For family devices, parental controls offer important protections. These controls, found in Screen Time settings, let parents:

  • Limit app usage and content
  • Prevent purchases
  • Set communication boundaries
  • Block specific features during certain hours

These settings help prevent children from accidentally locking devices through too many failed passcode attempts.

Regular Backup Practices with iTunes Backup Encryption

Backing up your iPhone regularly saves you from data loss if your device gets locked or disabled. You have two main options for backups:

iCloud Backups:

  • Happen automatically when connected to Wi-Fi
  • Store data securely in your iCloud account
  • Require sufficient storage space (may need paid storage)

iTunes Backups with Encryption:

  • Store data locally on your computer
  • Protect sensitive information with password encryption
  • Preserve important settings like passwords and health data

It’s smart to use both methods. Set a backup schedule and test restores occasionally to ensure your system works properly when needed.

Keeping iOS Devices Updated for Enhanced Security

Regular iOS updates provide critical security improvements that help prevent lockouts. Apple frequently patches vulnerabilities in each update.

Set your iPhone to automatically install updates overnight when connected to Wi-Fi and a charger. You can find this option in Settings > General > Software Update > Automatic Updates.

New iOS versions like iOS 14 and the upcoming iOS 18 introduce enhanced security features that protect against:

  • Phishing attempts
  • Unauthorized access methods
  • Known security weaknesses

These updates also improve the reliability of your device’s unlock mechanisms, reducing the chance of false lockouts due to system errors.

Restoring and Resetting iPhones to Factory Settings

When you can’t access your iPhone or want to start fresh, knowing how to reset it is important. There are several ways to restore your iPhone to factory settings.

Why Reset Your iPhone?

  • You forgot your passcode
  • Your phone is frozen or glitchy
  • You’re selling or giving away your device
  • You want to remove all personal data

If you know your passcode, resetting is simple. Go to Settings > General > Reset > Erase All Content and Settings. This will erase your iPhone completely.

Forgot your passcode? Don’t worry. You can still reset your device using a computer. Connect your iPhone to a computer with iTunes or Finder while holding the right button to enter recovery mode.

When connected, you’ll see an option to restore your iPhone. This downloads fresh software and removes all content.

Important Things to Remember:

  1. Back up your data before resetting
  2. Know your Apple ID password
  3. Remove your SIM card if you’re giving away the phone

After restoring to factory settings, your iPhone will look just like when you first bought it. You’ll need to set it up again from scratch.

If your iPhone is disabled after too many wrong passcode attempts, connecting to a computer is your only option. Some phones may erase automatically after 10 wrong tries if that setting is on.

Remember that an iPhone reset might lead to Activation Lock if you don’t know your Apple ID details. Always keep this information handy.

Frequently Asked Questions

Getting your iPhone unlocked can be tricky sometimes. Here are answers to common questions about different unlocking situations, from forgotten passcodes to carrier restrictions.

What are the steps to unlock an iPhone if I have forgotten the passcode?

If you’ve forgotten your iPhone passcode, you’ll need to erase your device. The easiest way is through the Find My iPhone feature.

Log into iCloud.com on another device and use the Find My feature to erase your iPhone remotely. After erasing, you can restore your data from a backup.

You can also connect your iPhone to a computer and put it in recovery mode. This process differs slightly depending on your iPhone model, but generally involves holding specific buttons while connecting to a computer.

How can I unlock my iPhone that is disabled without using iTunes?

When your iPhone becomes disabled, you can use iCloud’s Find My feature instead of iTunes. Sign in to iCloud.com and click on Find iPhone to erase your device remotely.

Another option is using Recovery Mode with Finder on newer Macs (macOS Catalina or later) instead of iTunes. The steps are similar to the iTunes method but use Finder to restore the device.

For newer iPhone models, you might also be able to use the built-in reset option by going to Settings > General > Reset if you can still access these menus.

What methods are available to unlock an iPhone for use with different carriers?

The most reliable way to unlock your iPhone for a different carrier is to contact your current carrier directly. Most carriers will unlock your iPhone if your account is in good standing and your device is fully paid off.

You can check if your iPhone is already unlocked by going to Settings > General > About and looking for “Carrier Lock” or “No SIM restrictions” information.

Some third-party services offer carrier unlocking, but be cautious as these aren’t always legitimate or effective.

Is it possible to unlock an iPhone without the original carrier’s involvement?

In most cases, carrier involvement is necessary for proper unlocking. However, some third-party services claim to unlock iPhones without carrier approval.

These services typically use your iPhone’s IMEI number to process the unlock. Be aware that using unauthorized unlocking services may void your warranty or violate terms of service.

For factory unlocked iPhones purchased directly from Apple, no carrier unlocking is needed as these devices already work with any compatible carrier.

Can I unlock my iPhone using its IMEI number for free?

Free IMEI unlocking is rarely legitimate. Most reliable IMEI unlocking services charge a fee for their services.

Your best option for free unlocking is going directly through your carrier. Many carriers will unlock your device at no cost if you meet their requirements, which typically include having your device paid off and your account in good standing.

Be wary of websites claiming to offer free IMEI unlocking, as they may be scams designed to collect your personal information.

What is the procedure to reset a locked iPhone with no access to a computer?

If you can’t access a computer, you can use another iOS device to reset your locked iPhone. The Quick Start feature allows you to set up a new iPhone using your old one’s settings.

Another option is using iCloud’s Find My feature from any web browser. Simply log in to iCloud.com, select Find iPhone, and choose the Erase option for your device.

If you have automatic iCloud backups enabled, your data will be preserved and can be restored after the reset process is complete when you sign back into your Apple ID.