Software & Apps > Windows 346 346 people found this article helpful How to Defrag Your Windows Computer Speed up your computer with the Windows disk defrag tool By Mark Baggesen Mark Baggesen Writer Southern Methodist University University of Massachusetts/Amherst The University of British Columbia Mark Baggesen is a former Lifewire writer who has 20+ years' experience and has in web development, communications, web analytics, and databases. lifewire's editorial guidelines Updated on May 14, 2022 Reviewed by Michael Barton Heine Jr Reviewed by Michael Barton Heine Jr Michael Heine is a CompTIA-certified writer, editor, and Network Engineer with 25+ years' experience working in the television, defense, ISP, telecommunications, and education industries. lifewire's editorial guidelines In This Article View All In This Article Prepare for Defragmentation Open the Defrag Program Analyze the Hard Drive Defrag the Hard Drive Should You Defrag Your Computer? Close What to Know Make sure your drive is backed up and healthy, close any open programs, and plug in your PC.Go to Control Panel > System and Security > Administrative Tools > Defragment and Optimize Drives.Select Analyze, then choose the hard drive that says Needs optimization and select Optimize or Defragment disk. This article explains how to defragment your Windows computer. Instructions apply to Windows 10, 8, and 7. Prepare Your Computer for Defragmentation Before you defrag your computer, you must take several steps. Read this entire procedure before you use the defrag utility. Make sure your work is backed up on an online backup service, a second local hard drive, an external hard drive, a flash drive, or a CD or DVD. Make sure the hard drive is healthy. Use CHKDSK to scan and fix the drive. Close any currently open programs, including virus scanners and other programs with icons in the system tray (on the right side of the taskbar). Make sure your computer has a constant source of power. If your computer shuts off while defragmenting, it may crash the hard drive or corrupt the operating system, or both. If you have frequent power issues or other outages, only use a defragmentation program with a battery backup. Open the Defrag Program The Windows defrag program is accessible through Control Panel in all versions of Windows. Still, the procedure for getting there is slightly different depending on which version of Windows you use. Open Control Panel. Alternatively, press WIN+R and enter control in the Run dialog box. Select System and Security. If View by shows icons, select Administrative Tools > Defragment and Optimize Drives. Under Administrative Tools, select Defragment and optimize your drives. For Windows 7, select Defragment your hard drive. A quicker way to get to the disk defrag utility is to run the dfrgui command in Windows 10 from the Run dialog box. Analyze the Hard Drive Before starting the defrag, analyze the drive first. This step checks the drive for fragments and reports how fragmented the drive really is, after which you can choose to defrag or skip the hard drive and not run a defrag. Choose Analyze (Windows 10, 8, and XP) or Analyze disk (Windows 7) to check for fragments on all the connected hard drives. Under Status, note the fragmentation level shown next to each drive. If the fragmentation level seems high (above 20 percent) or if the Current status displays Needs optimization, move to the next step to defrag the drive. Otherwise, you're probably safe skipping the defrag. Windows Vista does not include an option to analyze the hard drive. Defrag the Hard Drive If you chose to defrag the hard drive, it's only a click away. However, the button for defragging the drive is called something different in some versions of Windows. Under Drive, select the hard drive that shows Needs optimization under Current status. Select Optimize. For Windows 7, select Defragment disk. It could take anywhere from several minutes to several hours to defrag a hard drive. The time it takes to run a defrag on your hard drive depends on the number of file fragments the tool identifies, the size of the hard drive, and the speed of the computer. We have found it's best to start the defrag and then go to bed. With luck, it'll be done when you wake up in the morning. Should You Defrag Your Computer? Files stored on a hard drive become fragmented over time, meaning that parts of the files are stored in separate areas of the drive instead of next to each other. When this happens, it can take longer for the OS to open the file. A defrag can fix this. While there are lots of free, third-party defragmenters, you can use the Windows disk defragmenter without having to download anything since it's built into the operating system. The Windows defrag tool runs automatically once a week in Windows 10, Windows 8, and Windows 7, so you probably don't need to defrag on your own. Run the analyzer first, and if it's less than 10 percent fragmented, the drive does not need to be defragged. If you want to defrag on your own time, open the program anytime you want and run a manual defrag. You can get to it by searching through Windows or by browsing through Administrative Tools via Control Panel. Defragging isn't necessary on solid-state hard drives since there aren't any spinning parts. Since the hard drive doesn't need to spin to find all the file's pieces, there isn't a lag between finding the file and the time it takes to open it. ikuvshinov / iStock Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit