If you're planning to sell your old Mac, or trying to fix issues with an old Mac by doing a clean install of your software, you'll first need to reset your Mac to factory settings. Just how easy is it to wipe a Mac?

Fortunately it's easy to remove everything from a Mac before you sell it on - and it's very important that you do so if you don't want to leave yourself open to identity theft. However, as well as removing your personal information, before selling on an old Mac you do need to ensure a clean version of macOS is installed, or you might be hearing from the buyer.

Our guide to wiping all the data from a Mac enables you to reset your machine to an unblemished factory state, as if it was fresh out of the box. Here are the general steps to reset your Mac (they are outlined in detail below):

  1. Make sure you're connected to the internet so you can download the latest copy of the Mac operating system able to run on your machine. This is likely to be macOS Sierra, but an older Mac may need a version of OS X.
  2. Use an app like SuperDuper or Carbon Copy Cloner to clone your internal hard drive to an external drive. This enables you to access all your old files, and the drive can be re-cloned to the internal drive if you want to restore your Mac.
  3. Deauthorize your iTunes store account. (You should also deauthorize any third-party apps, such as Photoshop, that are locked to your Mac.)
  4. Turn off FileVault (if you're using it).
  5. Sign out of iCloud.
  6. Restart the Mac in Recovery Mode (hold down Command and the R key during restart).
  7. Use Disk Utility to erase the hard drive. Click on Disk Utility > Continue. Select the main volume and click Unmount then Erase). Quit Disk Utility (Disk Utility > Quit Disk Utility).
  8. Click Reinstall OS X and Continue. Follow the instructions to reinstall macOS.

Read next: Should I buy a secondhand Mac (or a new Mac)? | Which Mac should I buy? Desktop Mac buying advice | Selling your old Mac - How to find out what it is worth

Clone your Mac hard drive

How to reset a Mac to factory settings: Carbon Copy Cloner

The process of resetting a MacBook to factory settings gets rid of all your data from the Mac. Obviously, you should transfer data from your old Mac to a new one, but it's worth making a clone of the whole hard drive and keeping it around for a while.

The best way to do this is using a program like Carbon Copy Cloner or SuperDuper along with an external hard drive (they used to be free but both options are now paid for, sadly). Choose your main hard drive in the source, and your external hard drive in the Destination. Now click on Clone.

You should be able to boot from the cloned external hard drive. To test this, reset your Mac and hold down Option when you first boot up your Mac. Use the arrow keys on your Mac to select the external drive and tap Enter. This cloned drive can be re-cloned back to the main drive if you decide to restore your Mac, or it can be used to access all the original files from your computer after you have wiped the internal hard drive.

(Even though the software is bundled with Mac OS X, it's worth noting that Carbon Copy Cloner is now a paid-for app.)

Read next: How to recover your Mac from a backup

Deauthorise iTunes

You should deauthorise your computer from iTunes. This means that it will no longer be linked to your iTunes account. You can only use up to five Macs to play music and movies that are locked to your iTunes account, so you shouldn't pass that on to another person.

How to deauthorise iTunes on Mac

The precise method of deauthorising iTunes varies depending on which version you've got. In the latest version (above) you'll need to open iTunes and click Account > Authorisations > De-authorise This Computer. Enter your Apple ID and password and click De-authorise.

In older versions (below) you'll need to click Store > Deauthorise This Computer.

How to reset a Mac to factory settings: De-authorise iTunes

For related tips, see How to shut down your iTunes Store, iCloud and other accounts.

Turn off FileVault 

FileVault encrypts the files on your hard drive, and it's better to turn it off before going any further (you'll be wiping the files soon, so security shouldn't be a concern).

Open System Preferences and click on Security & Privacy, then select the FileVault tab. Check that it says 'FileVault is turned off for the disc [name of main hard drive]'. If not, click on the padlock icon in the bottom left, enter your password and click on Unlock. Now click Turn Off FileVault.

How to reset Mac: Turn off FileVault

Disable iCloud

How to reset a Mac to factory settings: Disable iCloud

Open System Preferences and click on iCloud and tap on Sign Out Now. To remove all your personal data, click 'Delete From Mac' on each popup (although you'll be wiping the hard drive in the next step anyway).

See: How to set up iCloud | How to delete or reset an iPhone or iPad

Restart your Mac in Recovery Mode

First of all make sure you are connected to the internet (a quick Google search should suffice). You'll need an internet connection to install macOS.

Restart the Mac by clicking Apple > Restart and hold down the Command and R keys until the Recovery Mode Utilities window appears.

Erase your Mac's drive

How to reset a Mac to factory settings: Erase Mac OS X drive

Select Disk Utility and click on Continue. Now choose your main Startup Volume (typically called Macintosh HD in the sidebar on the left), and click on Unmount.

Now choose the Erase tab and click Erase to wipe your hard drive. Note that this permanently erases all data on the hard drive so don't do this unless you've cloned the drive or are happy to never have to get something from that drive again.

When it's finished, exit the program by going to the top menu and selecting Disk Utility > Quit Disk Utility.

How to reset a Mac: Erase the hard drive

Reinstall macOS

How to reset a Mac to factory settings: Install macOS

Now click on Reinstall macOS and continue to follow the onscreen instructions. This will download and install a blank copy of macOS on the Mac. Do not enter your Apple ID and password during setup, though; allow the person buying the Mac (if that's the case) to finish the setup process themselves.