Skip to main content

How to defrag your computer

For decades, desktop and laptop owners have been told to defragment their hard drives to get the best performance, especially on Windows-based PCs. Defragging reorganizes the drive so the operating system isn’t spending more time gathering up all the scattered pieces when loading a program or file.

But times have changed. Modern PCs mostly depend on solid-state drives (SSDs), which don’t require or really support old-school defragmentation — indeed, it can actually harm their overall performance and lifespan. Even on computers with hard drives, MacOS and Windows are now more efficient than ever and perform the cleanup in the background. Likewise, Linux-based Chrome OS writes files in an extremely logical manner, requiring very little background defragmentation.

Recommended Videos

This guide will walk you through how to defrag your PC, but before you do, make sure that it’s worth doing.

Don’t defrag an SSD

OCZ SATA SSD
SATA SSD Auxo.co.kr

SSDs don’t share the same fragmentation problem as hard drives. There are no mechanical parts that move in search of file bits. Files can be fragmented, sure, but you won’t see the performance issues associated with spinning platters and moving heads. SSDs can find scattered blocks of data really fast.

Running a manual defrag on an SSD can be bad for the drive, too. Why? Because data is written to memory cells versus being stored magnetically in tracks on a platter. Over time, these cells wear out — defragmenting will reduce their overall lifespan. Moreover, SSDs use “wear-leveling” to write data across all cells so that they wear out evenly rather than in chunks.

Unlike hard drives, data is written to SSDs in pages — 128 pages equals one data block. Without the TRIM command, the SSD controller will temporarily move pages of wanted, valid data into memory, delete the pages of unwanted, invalid data, wipe the block clean, and then write the valid pages back into the block. Garbage collection takes place when the computer is idle.

The TRIM command is more efficient. It tells the SSD controller which pages of a block can be erased. Thus, instead of erasing the entire block and rewriting the valid data, the controller marks the invalid pages for garbage collection. This method prolongs the life of the SSD.

Ultimately, an SSD doesn’t need defragmenting. Moreover, manually defragmenting the drive will reduce its overall lifespan, so just let Windows and the SSD do their trash collection dance in the background.

You don’t need to defrag a Mac or Chromebook

Image used with permission by copyright holder

Modern Macs do not rely on hard drives but rather SSDs. However, if your Mac does have a hard drive, MacOS silently defrags the drive in the background, just like Windows 10.

On a deeper level, Apple’s older Hierarchical File System (HFS+) uses Hot File Adaptive Clustering, which automatically prevents file fragmentation by moving files that are frequently accessed (and mostly unchanged) to a special section. The newer APFS system, initially only supporting SSDs but expanded to hard drives and Fusion drives in Mojave (10.14), creates file snapshots instead.

While there isn’t a native defrag application built into MacOS like there is in Windows, you can find a few third-party tools to manually defrag the drive. Problem is, they don’t work with the newer Apple File System (APFS) built into High Sierra (10.13) and newer. These include:

Meanwhile, like modern Macs, Chromebooks don’t need defragging, as they rely on flash-based storage. Moreover, Chrome OS is based on Linux, which uses the ext2, ext3, and ext4 file systems. These platforms save files in different places with enough blank space around them to accommodate growth. If files become fragmented, the platform will move these files around to combine the scattered bits.

If performance is an issue, one extreme fix it to set both devices to their factory defaults. We have separate guides for MacOS and Chrome OS (aka Powerwash).

How to defrag a hard drive in Windows 10

Defrag Windows 10 Hard Drive
Image used with permission by copyright holder

Again, Windows 10 defrags your hard drive in the background. When you open the Optimize Devices tool, you’ll likely see that the drive is 0% fragmented. However, here’s how to manually defragment the drive if needed:

Step 1: Open File Explorer.

Step 2: The “This PC” panel should appear on the screen by default, displaying your drive(s). If not, click on This PC listed on the left.

Step 3: Right-click on the hard drive you want to defragment.

Step 4: Select Properties on the pop-up menu.

Step 5: Click the Tools tab on the following pop-up window.

Step 6: Click the Optimize button displayed under Optimize and Defragment Drive.

Step 7: If you have multiple drives, select the drive you want to optimize. Otherwise, move on to Step 8.

Step 8: Click the Analyze button. If the drive doesn’t need defragmenting, then click the Close button. If your drive needs defragging, click the Optimize button instead.

Step 9: Click the Close button to finish.

Topics
Kevin Parrish
Former Digital Trends Contributor
Kevin started taking PCs apart in the 90s when Quake was on the way and his PC lacked the required components. Since then…
Microsoft Word may delete your files — here’s how to avoid it
Windows 11 logo on a laptop.

There's a new bug in Microsoft Word that may delete your files, and according to user reports, they're not always recoverable through the Recycle Bin. Fortunately, Microsoft is aware of the problem, but it's unclear when the issue might be fixed. If you want to make sure that your files stay safe, we've got a few workarounds to help you out.

In the last few days, the Microsoft community boards have been flooded with reports of people complaining about their files randomly being deleted, with one user saying: "I use Word. Today, it deleted eight hours of work." Further reports quickly made it clear that the affected files have a few things in common.

Read more
How to check your GPU temperature
Nvidia GPU core.

Your gaming PC’s graphics card, otherwise known as a GPU, is one of its most important components, and it’s important to periodically check its temperatures to ensure longevity. Temperature is the primary factor affecting its decay, and you want it to last a long time -- especially in today’s market, where even the best graphics cards aren’t cheap.

Fortunately, keeping an eye on its temperatures isn’t difficult and can be accomplished in just a few moments with helpful tools. But there are a few other things to keep in mind, so let's dig in.
How to monitor your GPU’s temperature
By far, the easiest tool to check your GPU's temperature in Windows 10 can be found by firing up Windows Task Manager and jumping to the Performance tab. At the bottom of the list, you can find out what GPU you have in your system, where it is listed with its temperature between brackets. Use this to check your GPU temperature under a heavy gaming load, ensuring it is operating at or very close to 100% utilization.

Read more
How to overclock your graphics card GPU
Need to get a few more fps out of your GPU? Here's how to safely overclock it
graphics card shortage

Although upgrading to the best graphics card (also know as a graphics processing unit, or GPU) is arguably the best way to improve your PC's 3D rendering ability, you can eke out a little more performance from your existing card with overclocking.

Much like a CPU, a GPU contains chips that with the right tweaks can work harder and faster. That can mean better benchmark results and higher frames per second in your favorite games. Although still a little intimidating and certainly not friendly to your graphics card's temperatures, learning how to overclock your GPU is easier today than it's ever been. You just need the right tools, the right steps, and plenty of patience. Let us help show you how to overclock your graphics card GPU.
A word of warning
You can overclock a CPU, and you can overclock RAM. But overclocking anything has inherent risks. They are relatively low, but they are important to consider so that you're well informed before starting. Overclocking anything involves the process of forcing it to perform at a faster rate than it was manufactured to do so. That means you are pushing it harder and by working faster, it will get hotter and it may become less stable. That could result in crashes in the short term and over the long term, could reduce the lifespan of your particular hardware.

Read more