Sort MP3 files on an MP3 Player

Date Initially Written: 18 January 2005.

Problem: Many MP3 players that are based on USB flash drives don't allow you to sort the MP3 files in the order you want to listen to them. Instead they play the MP3 files in the order they find them; usually the order you copied them to the flash drive. How do we re-order the files?

Background: In the old DOS days Norton Utilities provided a tool called DS (Directory Sort) that would re-arrange the order of files in the FAT (File Allocation Table) directory structure. This was useful because many programs would only display or process files in the order they found them; they wouldn't allow you to sort the files. With the advent of Windows the need for DS was reduced as Windows usually sorts filenames before displaying them (i.e. in Explorer or the Windows file selector dialog box).

Many modern MP3 players are based on USB flash drives (i.e. Creative's MuVo range of MP3 players). These devices don't allow you to sort the MP3 files in the order you want to listen to them. Instead they play the MP3 files in the order they find them; usually the order you copied them to the flash drive. Unfortunately if you select a bunch of files in Windows' Explorer and copy them to your MP3 player, they don't always copy in alphabetical order (even if you have told Explorer to display the files alphabetically). And of course you may want to add new MP3 files at a latter date, which will result in them being added to the end of the directory.

Norton's old DS utilities was designed for FAT16 drives and so won't work with newer drives that are FAT32. The addition of long file names (VFAT) further complicates matters. Duncan Murdoch wrote a utility called LFNSORT which went some way to addressing the problems with Norton's DS not working with newer file systems, but unfortunately LFNSORT doesn't work with newer versions of Windows (i.e. Windows 2000 and later).

Early versions of the Windows Defrag tool would also re-sort the directory, but this ability seems to have been removed from newer versions.

Resolution Steps: There are a few programs around that allow you to sort files by filename:

  • FAT Reader A little program written in VB .NET that lets you sort the file and folder entries of a FAT file system, giving you complete control of their order. Unlike some other FAT sorting tools, FAT Reader not only has a GUI but can also do real sorting on the filesystem level. And because it communicates with the device drivers, it should be able to handle all drives that Windows recognizes as FAT, be it an MP3 player, USB stick or harddisk, even mounted TrueCrypt volumes work.
  • DriveSort Offers a feature rich GUI that lists all files by the order they are stored in FAT system. DriveSort Playlist Mode allows manual custom sorting of files in any order user prefers (requires Windows 2000 or later).
  • FATSort Utility (requires Linux).
  • Fat Sorter Sorts alphanumeric (requires .Net 2).
  • mp3DirSorter
  • YAFS (Yet Another FAT Sorter) is a multi-platform (Windows and Unix) C/C++ open-source (GPL3) program that can sort the files and directories of a FAT file system (FAT16 and FAT32). It operates directly on the FAT file system structure changing the order of its entries. Visual YAFS is a GUI for YAFS.
  • Plgen Playlist Generator is a freeware Linux program written in Python.
  • NewFAT32Sorter Sorts Files on FAT, FAT32 devices, with GUI, easy to use (requires Java).

If you know of any other programs then please contact me.

Update (22 April 2008): My latest MP3 player, an iAudio U2, has the ability to specify the sort order (by file name or by file date). This is a great feature that more MP3 players should implement.

Update (23 June 2010): I was contacted by Steffen who has written a clever little Windows Command Shell script that will recursively sort the files in a folder and any subfolders and files. Although developed under Windows 7 this script should work fine on Windows 2000 and later. Full documentation is included within the script file. Thanks Steffen! Download script file here.

Update (2 August 2011): Rich Pasco contacted me to let me know about mp3DirSorter and YAFS (Yet Another FAT Sorter). Thanks Rich!

Update (30 December 2011): Udi Cohen contacted me to let me know that he has spent some time researching the problem and has a very nice write-up about his research and the utility program that he wrote. Thanks Udi!

Update (12 August 2013): Benjamin Kent contacted me to tell me about a new freeware program that he has created called Plgen (Playlist Generator). More information and a download can be found at the Freecode page or the Sourceforge page. Thanks Benjamin!

Update (13 February 2014): Stefan Sax contacted me to tell me about his NewFAT32Sorter program, written in Java. More information and a download can be found at the GitHub page. Thanks Stefan!

Update (31 March 2015): Alessandro Sanasi contacted me to tell me about his FAT Reader program. More information and a download can be found at the FAT Reader page. Thanks Alessandro!

Recommended Reading For MP3 Users: MP3: The Definitive Guide