How to securely erase your iPhone or Android smartphone

Android 
Most Android smartphones aren't encrypted out of the box, so securely erasing your device will take a few more steps.

Firstly, you'll need to encrypt your phone. On most modern Android smartphones, you'll find this option by opening up "Settings", scrolling down to "Security" and selecting "Encrypt phone". On Samsung devices this is found in "Other security settings", which sits under "Lock screen and security". If you're having trouble finding this option, you should just be able to search for "Encrypt" in the “Settings” app.

This process can take some time, so you'll need to have your phone plugged into a charger to encrypt it.

After you've encrypted your phone, you'll need to go back to the "Settings" menu and choose "Backup & reset". You'll then want to tap "Factory data reset" which will wipe your phone completely. Again, if you're having trouble finding this, simply search for "factory".

If you're ultra-paranoid, you can always fill your factory reset phone with nonsense data before repeating the aforementioned steps, but personally I'd call this overkill.