Should I defrag my SSD?

Over the last few years, SSDs have become the standard storage device for enthusiasts and gamers alike. Some would even say they are the most impactful upgrade for your PC. They are smaller, faster and have gotten much more reliable over the years. But do you need to defrag them?

I remember the days when solid state drives were something you looked at pictures of because they were too damn expensive to get one for yourself. If you wanted to increase the speed of your storage, de-fragmentation would have to suffice. Before we talk about whether defragging your SSD is a good idea, it’s important to understand why it’s beneficial for traditional spinners.

HDDs operate using a physical spinning platter, with drive 'heads' that have to be positioned over the correct data. (Think of it like a vinyl record player, only much faster.) Data is stored on different sections of the platter in sequentially ordered blocks. In order to access a block for reading or writing, the drive heads need to be positioned over the correct sector (seek time), and then the desired block must pass under the drive heads (rotational latency). Combined, these two steps give the access time for a drive. For a typical 7,200 rpm drive, the rotational latency is 4.17ms (half of one rotation) and the seek time is around 8-12ms.

With usage, data that was once sequentially ordered on a drive can become split across different blocks. This is called fragmentation, and as this happens the drive heads need to access the data from two (or more—sometimes many more) different sections of the platter, drastically decreasing performance. Defragmentation reorders the blocks of data sequentially and attempts to restore your hard drive's original performance.

What about SSDs—do they benefit from defragmentation? The simple answer is no. The entire basis of fragmented data relies on the fact that your storage device uses moving parts to access data. Since SSDs have no moving parts, hence “Solid State”, there's no seek time or rotational latency. Instead, SSDs access flash memory (NAND) at much higher speeds, typically less than 50us—that's 50 microseconds, or compared to a typical hard drive with a 15ms average access time, about 300 times faster. But there's more to the story than just speed.

SSDs don't just eliminate moving parts and improve access times, they also have built-in wear-leveling algorithms. The reason is that the NAND gates wear out over time, and are rated in program/erase cycles. Each cell in a modern SSD can be written between 1,000-3,000 times before the cell stops working properly. To avoid individual cells that contain frequently changed data from wearing out faster, SSDs track usage of each block, and the wear-leveling algorithms ensure that over time, the cells on an SSD are written a similar number of times. There are also extra blocks that aren't user accessible (called spare area) that the algorithms can use to keep the drives from wearing out.

Because of the way SSDs work, not only does data not become fragmented, but running a defragmentation utility will actually burn through the program/erase cycles and potentially cause premature 'death' of your SSDs. It's not something that would happen quickly—a 500GB Samsung 850 Evo as an example is rated for 150TB of total writes, or the equivalent of writing to every block of the drive at least 300 times. With typical users writing less than 20GB per day on average, it would require more than 20 years to burn through 150TB of writes. But defragmenting could easily write hundreds of GB of data, which would wear out an SSD much faster.

The good news is that any defragmentation program worth using should also detect the presence of an SSD and warn you not to defrag it. So save your time and do something more useful like playing games instead of defragging.