How do I install and format new hard drive in mid-2012 Macbook pro? My hard drive in my Macbook completely broke a few weeks ago (didn't have much on it thankfully), so I bought a new hard drive and replaced the old one.

Now I'm not too sure how to set this new hard drive up (as in putting an OS on it and formatting it correctly) - I'm not concerned with getting any of my old data back on it, I just want to set it up as a new Macbook. Similar questions I have found all seem to ask how to set it up with all the old data. How do I boot the system up (safe boot, recovery etc.)? and what do I need to do once it's booted up?

Any help is much appreciated.
This answer is more tailored to your question.


Install the new HDD.
Boot to Internet Recovery. Startup your Mac and immediately hold down the option+⌘+R key combination.
Release the keys when the Apple logo or a spinning globe appears
Use the Disk Utility application to erase the HDD. When prompted, select the "Mac OS Extended (Journaled)" format. You will also have the option to select "APFS". Some notes about APFS is given below.


The Apple File System (APFS) was introduced with High Sierra.
Many users have reported problems repartitioning their drives when APFS is in use.
Many users have report difficulties using the Boot Camp Assistant to install Windows when the APFS format is used. 
You can convert to APFS later, if you wish.

Install macOS.
Restart to the newly installed macOS.


Below is a more generic answer.


Install the new drive.
Boot to Internet Recovery. Startup your Mac and immediately hold down the option+⌘+R key combination.
Release the keys when the Apple logo or a spinning globe appears
Open a Terminal window and enter the following commands.

diskutil  unmountdisk  disk0
diskutil  eraseDisk  free  none  disk0



  Note: Normally you should not have to use the diskutil commands to erase the drive. Occasionally, step 5 fails, if step 4 is skipped. If you feel lucky, you can try omitting this step.

Use the Disk Utility application to erase the drive. When prompted, select the "Mac OS Extended (Journaled)" format. If you desire encryption, then select "Mac OS Extended (Journaled, Encrypted)" format instead.
Install macOS.


  Note: If you are installing High Sierra (macOS 10.13.x) to a SSD, this drive will probably be converted use the APFS format.

Restart to the newly installed macOS.
If the installed macOS is not the current macOS, then download and install the current macOS from the Apps Store.