If you're passing on an old Mac to family or friends, selling your machine, or simply looking to fix a misbehaving machine, resetting it to factory settings is a useful and often necessary process.

Fortunately it's easy to remove all the data and content 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. Just remember that if someone is going to be using the Mac after you, removing personal information alone isn't enough - you also need to make sure there's a working version of macOS installed afterwards.

Our guide to wiping all your data from a Mac enables you to reset your machine to an unblemished factory state, as if it was fresh out of the box, with a clean and working install of macOS.

In brief, here is how to reset your Mac. Further detail is given below and linked from each step.

  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.
  2. Either back up your Mac using Time Machine or 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. Read more about this step here.
  3. Deauthorise your iTunes store account. (You should also deauthorise any third-party apps, such as Photoshop, that are locked to your Mac.) Read more.
  4. Sign out of and disable iCloud. Read more.
  5. Restart the Mac in Recovery Mode. Hold down Command and the R key during restart - or use alternative key combination as appropriate.
  6. 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). Read more.
  7. Click on Reinstall macOS or Reinstall macOS and Continue. Follow the instructions to reinstall macOS. Read more.

Clone or back up your Mac hard drive

Resetting a Mac to factory settings gets rid of all the data stored on that machine, so you should copy the data to a new Mac first. This can be done simply using Time Machine - here's how to back up using Time Machine and how to move data to a new Mac.

It's also worth making a clone of the whole hard drive and keeping it around for a while, just in case.

The best way to do this is using a program like Carbon Copy Cloner or SuperDuper (both are available as free trials) along with an external hard drive. Choose your main hard drive in the source, and your external hard drive in the Destination. Now click on Clone.

How to factory-reset a Mac: Carbon Copy Cloner

You should be able to boot from the cloned external hard drive. To test this, reset your Mac and hold down the Option/Alt key when you 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.

Deauthorise iTunes

You should deauthorise your computer from the iTunes Store. This means it will no longer be linked to your iTunes account. (This is important because you can only use up to five Macs to play music and movies that are locked to your iTunes account.)

How to factory-reset a Mac: Deauthorise iTunes on Mac

The precise method of deauthorising iTunes varies depending on which version you've got.

macOS Catalina

If you're running macOS Catalina, iTunes no longer exists as a standalone app, so you will instead access the iTunes Store via the new Music app.

Open the Music app, and select Music > Preferences from the menu bar. Now go to the General tab and select iTunes Store. From here you can access your account and choose to deauthorise this computer.

iTunes 12

If you're running a Mac that has iTunes 12, you'll need to open iTunes and click Account > Authorisations > De-authorise This Computer. Enter your Apple ID and password and click De-authorise.

iTunes 11 and earlier

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

How to factory-reset a Mac: Deauthorise iTunes

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).

  1. To turn off FileVault, start by opening System Preferences.
  2. Click on Security & Privacy.
  3. Then select the FileVault tab.
  4. 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 user name and password and click on Unlock.
  5. Now click Turn Off FileVault.
  6. You will need to enter your user name and password again and you may need to wait a while while decryption takes place.

How to factory-reset a Mac: Turn off FileVault

Disable iCloud

The next step is to turn off iCloud. Before you start, if you have any iCloud files that were created on that Mac they will be archived into your home folder (so remember to copy them to your backup).

  1. Open System Preferences and click on iCloud.
  2. Tap on Sign Out.
  3. To remove all your personal data, untick the boxes beside iCloud Drive, Contacts, Calendars and Reminders. Then click Continue. (Or click 'Delete From Mac' on each popup if you're using an earlier version of macOS.)

    How to factory-reset a Mac: Disable iCloud

  4. You may see a warning that iCloud Drive needs to finish updating before continuing with sign out.

    How to factory-reset a Mac: iCloud Drive needs to finish updating

  5. If you've got a MacBook Pro or MacBook Air with Touch ID you will need to confirm that your payment details should be removed from the Mac. Signing out will remove any Apple Pay information.
  6. Next you will be required to enter your Apple ID password.

Now you just need to wait while iCloud does its stuff.

Restart your Mac in Recovery Mode

Now you have backed everything up, and shut off your iCloud connections, you are ready to wipe the Mac.

  1. To enter Recovery Mode, click the Apple logo at the top left of the screen and select Restart.
  2. Immediately hold down the Command and R keys until you see an Apple logo or spinning globe. (You may be better off using a different key combination depending on the age of your Mac, and which macOS you want installed or was installed on the Mac when you bought it - we have a complete guide to starting a Mac in Recovery Mode here). For example, Apple recommends that "if you're selling or giving away a Mac that is using OS X El Capitan or earlier, use Option-Command-R to make sure that the installation isn't associated with your Apple ID".
  3. Expect it to take a while for the Mac to start up in this mode.
  4. You may see a screen asking you to choose a language.
  5. The next screen you'll see is the Recovery Mode Utilities window. In macOS Sierra and later it looks something like this:

How to factory-reset a Mac: Recovery Mode Utilities

If you're having problems because Command R isn't doing the trick, read this: How to reinstall macOS if Recovery won't work.

Erase your Mac's drive

Now you're ready to erase your drive.

  1. Select Disk Utility from the options, and click Continue.
  2. Click on your main hard drive, typically called Macintosh HD, in the sidebar on the left. You're looking for the disk name, not the volume name indented underneath it if that appears. How to factory-reset a Mac: Disk Utility
  3. To wipe your hard drive, click the Erase button then click Erase. 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 access anything on that drive again. How to factory-reset a Mac: Erasing the hard drive
  4. When it's finished, exit the program by going to the top menu and selecting Disk Utility > Quit Disk Utility.

Reinstall macOS

You can't just sell your Mac having erased the contents. You now need to reinstall macOS.

You should still be in macOS Utilities.

  1. Select 'Reinstall macOS' or 'Reinstall OS X' from the option and click Continue.
  2. You'll see a screen indicating that your Mac will install the version of macOS your Mac shipped with. Click Continue.
  3. Now you need to agree to the terms and conditions before the software will install. Click Agree.
  4. Choose where you want to install the software - this will be the Macintosh HD shown. Click on that and then click on Install.
  5. Your Mac will download and install a fresh copy of macOS on the Mac, this may take some time.
  6. macOS will restart when installation is complete. You may be asked for your Apple ID and password.

If you're passing on the machine, it's wise to quit the setup assistant at an early point and allow the person buying the Mac to enter their own information.

How to install an older version of Mac OS X using Recovery mode

We have another article that goes into more detail on what to do if you want to install an older version of macOS. But if you want to install an older version of the Mac operating system, this is what to do:

If you're running Sierra 10.12.4 or later, pressing Shift + Option + Command + R when you first boot up your Mac into Recovery mode will allow you to install the version of MacOS that came with your Mac, or the one closest to it that is still available.

If you need to install an older version of the Mac operating system and are wondering how you can do that if you haven't got the original discs, read this: How to install old versions of Mac OS X.