Does your iPhone keep restarting by itself? Whether it happens at random times with gaps in between or your iPhone is stuck in an infinite boot loop, you can use these steps to fix it.

Depending on how frequently your iPhone restarts, you might not reach the settings in each and every each step, but do your best to make it to the end and you'll be sure to find a solution.

Back Up Your iPhone First

Several of the troubleshooting steps below suggest erasing or restoring your iPhone to stop it from restarting. Of course, if you don't back up your iPhone first, you'll lose all the data on it when you do this: apps, messages, photos, and more.

Even if you choose not to erase or restore your iPhone, the fact that it keeps restarting could point to a serious hardware problem. This might be your last chance to back up your iPhone before it stops working completely.

The easiest way to back up your iPhone is by using iCloud.

Open the Settings app and tap your name at the top. Select iCloud, then scroll down and tap iCloud Backup. Choose to Back Up Now and wait for the backup to complete.

Back Up Now option in iCloud Backup settings on iPhone

If that isn't possible---perhaps because your iPhone keeps restarting mid-backup---connect your iPhone to a computer and try to back up using iTunes or Finder instead.

Step 1. Update iOS and Your Apps

Most of the time, your iPhone keeps restarting because of a software bug. It's easy to patch these bugs by installing the latest software updates available for iOS and all the apps on your iPhone.

Go to Settings > General > Software Update to update iOS on your iPhone. If that doesn't work, connect it to a computer and update iOS using iTunes or Finder instead.

After updating iOS, open the App Store and tap the Profile icon in the top-right corner. Then choose to Update All the apps on your iPhone.

Step 2. Free Up More Storage

Even if you have a 64GB iPhone, you shouldn't cram it with 64GB worth of content. Instead, it's much better to keep at least 10 percent of your storage empty.

Your iPhone uses this free space to copy files, move data around, and work more efficiently while processing tasks. If your storage is completely full, your iPhone can't work as well, which might explain why it keeps restarting.

Go to Settings > General > iPhone Storage to take a look at your storage usage. Then use our tips to create free storage on your iPhone if you need to make more space.

Step 3. Uninstall Problematic Apps

Even after updating all your apps, some of them can still cause problems. If an app is poorly developed or hasn't been updated in a long time, it might make your iPhone restart every time you open it.

Try to take notice of which apps you're using when your iPhone restarts. If the same app keeps cropping up, uninstall it from your iPhone and switch to an alternative app instead.

To uninstall apps, go to Settings > General > iPhone Storage, then scroll down and tap on the relevant app. In the app details page, tap Delete App.

Step 4. Reset All Settings

It's unlikely, but a problem with your settings could cause your iPhone to keep shutting down or restarting. Fortunately, you can reset all the settings on your iPhone without losing any other data on your device.

The only major downside to resetting your settings is that you'll need to input the Wi-Fi passwords for all networks you use again.

To reset your settings, go to Settings > General > Reset and tap Reset All Settings.

Step 5. Remove Your SIM card

Even your SIM card can cause your iPhone to restart. This usually happens if your SIM card can't connect to the carrier for some reason. It can even lead your iPhone to get stuck in a boot loop that's hard to escape from.

All you need to do is use a SIM pin or a straightened paperclip to pop the SIM tray out of your iPhone.

SIM card tray sliding out of iPhone 6S

If this works, but then your iPhone keeps restarting again when you reinsert the SIM card, keep following the next steps to force restart and restore your iPhone before putting the SIM card back in.

If your iPhone still keeps restarting after this step, ask your carrier for a replacement SIM card.

Step 6. Force Restart Your iPhone

It's not usually a good idea to force restart your iPhone, just like it isn't wise to rip the power cord out of a desktop computer.

But drastic times call for drastic measures. And if your iPhone keeps restarting or is stuck in a boot loop, sometimes the only way to fix it is using a force restart, also known as a hard reset.

The steps to force restart your iPhone change depending on which model iPhone you have. Take a look at our guide on how to force restart your iPhone for full instructions.

Step 7. Restore iOS Using a Computer

Speaking of drastic measures, if your iPhone still keeps restarting at this point, it's time to erase all your data and reinstall iOS. This could take an hour or more to do, so wait until you won't need your iPhone for a while before getting started.

Although it's possible to erase your iPhone using the Settings app, we need to reinstall iOS as well. And the only way to do that is by restoring your iPhone using a computer.

It's best to restore your iPhone using DFU mode, which reinstalls the firmware and software on your device. Follow these instructions to restore your iPhone using DFU mode. But remember to back up your iPhone first if possible.

Step 8. Inspect Your iPhone for Physical Damage

After restoring iOS, you can rule out software as the reason your iPhone keeps restarting. That leaves only hardware as the culprit, which means your iPhone probably needs a physical repair.

Inspect the outside of your iPhone looking for signs of damage. This could come in the form of scratches from an accidental drop, water marks from liquid damage, or broken pins inside the charging port.

It's also worth going to Settings > Battery > Battery Health to see if your battery needs replacing.

iPhone with Battery Health warning

Any of these issues could cause your iPhone to keep restarting.

If you think your iPhone needs a physical repair, visit Apple Support to book an appointment at the nearest Apple Authorized Service Provider.

You Might Be Able to Repair Your iPhone Yourself

Hopefully, you figured out why your iPhone was restarting over and over. If physical damage seems like the cause, you're probably not happy. However, in case you can't afford to pay someone else to fix it, you might be able to fix it yourself instead.

It isn't easy to pry open and replace the delicate components inside an iPhone, but it's certainly possible with the right tools, a steady hand, and a lot of patience.

If you think you've got what it takes, there are plenty of websites available that walk you through every step of the process. You can even buy repair kits from these sites and follow guides to repair all kinds of other gadgets as well.