How to factory reset an iPhone
how-to-guides
Wondering how to erase all the data from your iPhone, iPod Touch, or iPad? You’ve come to the right place. If you factory reset an iPhone, everything will be wiped from the device and it’ll return to the same state it was in when you first took it out of the box. If you’re planning on selling your iPhone, you should always do a factory reset beforehand. Otherwise, the buyer will have access to all of the personal information that you have stored on the device. A factory reset can be done in two ways: from your computer via iTunes or directly from your untethered phone. In this tutorial, we’ve included directions for both methods.
*Note: This tutorial is generic and will work for any version of iOS. That means the following steps will also perform a factory reset on any generation of iPad or iPod Touch.

From iTunes

Step 1: Plug in your iPhone to your computer via the USB adapter cable.
Step 2: Before you do anything else, sync your phone with iTunes. This will create a backup of all your pictures, music, apps, contacts, etc. which you can use to restore other iDevices from. 
Step 3: After the sync is finished, scroll up to the top of the iPhone page in iTunes and click the Restore button in the top right.
iPhone factory reset instructions

From iPhone

To perform a factory reset on your iPhone without plugging it in, follow these steps. It should be noted, however, that this will erase absolutely everything on the phone, so you might want to consider backing your device up in iTunes first.Factory reset iphone erase
Step 1: Fire up your iPhone and hunt down the Settings icon. Tap it.
Step 2: Scroll and find the tab labeled General. Tap it.
Step 3: Scroll to the bottom of this menu and tap the Reset tab.
Step 4: Tap Erase All Content and Settings.
Step 5: If you’re ready to wipe everything form your phone, tap the red Erase iPhone button.
At this point, your phone will be inoperable for the next few minutes while it erases itself. Once it’s done, you can turn it back on and everything will be just like it was when it came off the assembly line at Foxconn.