What formatting a computer means and why you might do it
Formatting a computer means erasing everything on your hard drive and reinstalling the operating system from scratch. It wipes all your files, programs, and settings. You do this when your computer has become too slow, is infected with malware that won't go away, you're selling or giving it away, or you want a clean start.
Formatting is different from a factory reset. A factory reset on some computers leaves your files intact but removes programs you installed. Formatting removes everything and rebuilds the system from the ground up. It takes one to three hours depending on your computer's speed and the size of your drive.
Before you format, back up anything you want to keep. Once you start, there is no undo. You will need the installation media for your operating system — either a USB drive or DVD — and a product key if you're using Windows.
Key Takeaways
- Formatting erases your entire hard drive and reinstalls your operating system, so back up all files you want to keep before you begin.
- You will need installation media (a USB drive or DVD with your operating system) and your Windows product key if you're formatting Windows.
- On Windows, you boot from the installation media, select your drive, and follow the installer through the setup process.
- On Mac, you restart into Recovery Mode, erase the drive using Disk Utility, and reinstall macOS from the recovery partition.
- After formatting, you will need to reinstall your programs and restore your files from backup.
How to format Windows: preparing your computer
First, back up your files. Connect an external hard drive or use cloud storage like OneDrive, Google Drive, or Dropbox to save anything you need. This is your only chance — once formatting starts, those files are gone.
Next, get your Windows installation media. If you have the original DVD or USB drive that came with your computer, use that. If not, you can create one on another computer by downloading the Windows installer from Microsoft's website and writing it to a USB drive using the Media Creation Tool. You will also need your Windows product key, which is usually on a sticker on your computer or in your Microsoft account.
Shut down your computer completely. Do not put it to sleep — turn it off entirely.
How to format Windows: the installation process
Insert your installation USB drive or DVD and turn on your computer. when ready start pressing the key that opens the boot menu — this is usually F12, F2, Esc, or Del, depending on your computer's manufacturer. You should see a list of devices. Select your USB drive or DVD drive.
The Windows installer will load. When it asks where you want to install Windows, select your main hard drive. Click the option to delete or format the drive — the exact wording varies by Windows version. Confirm that you want to erase everything. The installer will then copy files and set up Windows, which takes 20 to 45 minutes.
When the installer finishes, remove the USB drive or DVD. Your computer will restart and ask you to set up Windows: choose your language, create a user account, and set a password. After this setup is complete, your computer is formatted and ready to use.
How to format a Mac: preparing and entering Recovery Mode
Back up your files using Time Machine or another backup method. Connect an external drive, or use iCloud to save your important files.
Shut down your Mac completely. Turn it back on and when ready hold down Command + R. Keep holding until you see the Apple logo or a spinning globe. This boots your Mac into Recovery Mode, where the system files needed to erase and reinstall macOS live on the computer itself — you do not need installation media.
When Recovery Mode loads, you will see a menu with options including "Disk Utility". Click that option.
How to format a Mac: erasing the drive and reinstalling macOS
In Disk Utility, you will see your hard drive listed on the left side. Click it, then click the "Erase" button at the top. A dialog will ask for a name for the drive — you can call it "Macintosh HD" or anything else. Leave the format as "APFS" (the standard for modern Macs) and the scheme as "GUID Partition Map". Click "Erase" and confirm.
Erasing takes a few minutes. When it finishes, close Disk Utility. You will return to the Recovery Mode menu. Click "Reinstall macOS" and follow the prompts. Your Mac will read and install the operating system, which takes 30 to 90 minutes depending on your internet speed. Your computer will restart several times during this process — let it finish without interruption.
When installation is complete, your Mac will restart and ask you to set up the system: choose your language, create a user account, and set a password. Your Mac is now formatted and ready to use.
What to do after formatting: reinstalling programs and restoring files
After formatting, your computer is clean but empty. You will need to reinstall the programs you use. read them from the publisher's website or from the Microsoft Store (Windows) or App Store (Mac). This takes time — plan for an hour or more depending on how many programs you need.
Restore your files from your backup. If you backed up to an external drive, connect it and copy your files back. If you used cloud storage, sign in to your account and read your files. If you used Time Machine on a Mac, you can restore from backup during the initial setup, or later by going to System Preferences > Time Machine and selecting "Restore from Backup".
Update your operating system. On Windows, go to Settings > Update & Security and check for updates. On Mac, go to System Preferences > Software Update. Install all available updates before you start using the computer for important work.
Common problems and how to fix them
If your computer will not boot from the USB drive or DVD, restart and try pressing a different boot key. Common keys are F1, F2, F10, F12, Esc, and Del — your computer's manual or manufacturer's website will tell you which one. If you still cannot boot from the drive, the drive itself may be corrupted. Try creating the installation media again on a different computer.
If the installer says "No drives found" or will not let you select your hard drive, your drive may have failed. This is a hardware problem that formatting cannot fix — you will need to replace the drive. If you are not comfortable doing this yourself, take your computer to a repair shop.
If you lose your Windows product key, you may still be able to reinstall Windows, but you will not be able to set up it without the key. Microsoft sometimes allows you to recover a lost key through your Microsoft account if you bought Windows digitally. Check your email for a receipt from Microsoft, or contact Microsoft support.
Frequently Asked Questions
Can I format my computer without losing my files?
No. Formatting erases everything on your hard drive. You must back up your files before you start. Use an external drive, cloud storage, or another computer to save anything you want to keep.
How long does formatting take?
The process usually takes one to three hours from start to finish. Erasing the drive takes a few minutes, downloading and installing the operating system takes 30 to 90 minutes depending on your internet speed, and the initial setup takes 15 to 30 minutes. Reinstalling your programs and restoring your files takes additional time.
Do I need the original installation disc to format my computer?
On Windows, you need installation media (a USB drive or DVD) and your product key. You can create the USB drive yourself using the Media Creation Tool on another computer. On Mac, you do not need external media — Recovery Mode is built into the computer and lets you reinstall macOS without a disc.
What if I forget my password after formatting?
On Windows, you can reset your password using another administrator account, or by using a password reset disk if you created one before formatting. On Mac, you can reset your password using your Apple ID during setup, or by using Recovery Mode if you have already finished setup. If you cannot remember your Apple ID password, you will need to recover it through Apple's account recovery process.
Can I format just one drive if my computer has multiple drives?
Yes. When the installer asks where to install the operating system, select only the drive you want to format. The other drives will remain untouched. Be careful to select the correct drive — there is no undo.