How to sort your music library automatically
A practical guide for DJs, collectors and diggers who buy music as downloads and want one consistent folder layout without sorting by hand.
Last updated:
How can I sort my music automatically?
Use the tags that are already inside your files and a folder template. A sorter reads each file's artist, album, track number, title and genre, builds a path such as House/Artist/Album/01 Title.flac, and moves every file there in one run.
Tags are small text fields stored inside the audio file itself. MP3 files store them as ID3 tags; FLAC files store them as Vorbis comments. Because the information travels with the file, the sort works the same whether you have 50 tracks or 50,000, and you can repeat it any time with the same result.
What do I need before I start?
- A backup, or at least the plan to copy rather than move on the first run.
- Unzipped downloads. Album purchases usually arrive as one zip per release; unzip them all into one inbox folder.
- One format per copy of a release. If you download the same album as FLAC and MP3, sort them into separate roots (for example
Sorted-FLACandSorted-MP3) so they do not collide. - A decision on the layout (see the table below).
Which folder structure works best?
For DJs, start with genre; for collectors, start with artist. Both work with the same tags; only the template changes. These are our recommendations, not a standard.
| Layout | Template | Good for | Trade-off |
|---|---|---|---|
| Genre first | {genre}/{albumartist}/{album}/{track} {title} | DJs who browse by style | Genre is read per track, so an album whose tracks carry different first genres is split across folders |
| Artist first | {albumartist}/{album} ({year})/{track} {title} | Collectors, full-album listening | Harder to see everything of one style |
| Year first | {year}/{albumartist} - {album}/{track} {title} | Diggers tracking eras | Reissues sort under the reissue year |
| Flat crates | {genre}/{artist} - {title} | Quick DJ crates of single tracks | Album context is lost from the path |
Use {albumartist} rather than {artist} for album folders. On compilations and split releases, the track artist changes from track to track, which would scatter one album across many folders. The sorter falls back to the track artist when the album artist is empty.
How do I sort my downloads step by step?
- Collect. Unzip everything into one folder, for example
Music inbox. - Open the sorter and choose that folder. On a library of a few thousand tracks, reading the tags takes seconds because only the tag bytes are read, not the audio.
- Pick a template from the table above and set a root folder such as
Sorted. - Clean the genres. Look at the genre chips. Add aliases for spellings you want merged (see the genre guide).
- Review the plan. Rows marked "file name" or "nothing" had no usable tags; check them first.
- Run the script from the folder that contains your inbox. Start with "copy" mode, check the result, then delete the inbox yourself.
What happens to files with no tags?
They are sorted by their file and folder names, or put in an "Unknown" folder if there is nothing to read. The sorter understands two common naming patterns:
| File or folder name | Read as |
|---|---|
Artist - Album - 01 Title.wav | artist, album, track 1, title |
folder Artist - Album with file 01 Title.wav | artist and album from the folder, track and title from the file |
track7.wav in a folder untitled | title only; goes to Unknown Genre / Unknown Artist / Unknown Album |
WAV files are the most common case: the format has no standard place for these tags that every program reads, so many WAV downloads carry their information only in the file name. If a store offers a choice, FLAC keeps the same lossless audio and carries full tags.
Which characters are changed in folder and file names?
To keep paths valid on every common desktop system, the sorter replaces < > : " / \ | ? * and control characters with a space, removes dots and spaces at the start or end of a name, drops empty brackets (for example () when the year is missing), and cuts each folder or file name at 120 characters. If two files end up with the same path, the second one gets (2) added instead of overwriting the first.
How do I keep my library sorted as I buy more music?
Keep one inbox folder for new purchases and run the sorter on it whenever it fills up. Because the script never overwrites and uses the same template, new releases slot into the existing tree.
- Download new purchases into the inbox only.
- Keep your alias list in a text file and paste it into the sorter each time, so genres stay consistent.
- Run in copy mode, check, then empty the inbox.
Can I sort my music on a phone?
You can choose files and see the full plan on a phone, and download the CSV. Running the script needs a desktop terminal, because phone browsers cannot move files on your storage.
Where do these facts come from?
Every statement about tag formats on this page comes from the published format specifications listed here. Advice on folder layouts and genre lists is our own recommendation and is marked as such.
- ID3v1: the original ID3v1 tag description, archived at
id3.org/ID3v1(128-byte tag at the end of the file, one-byte genre number, genres 0 to 79). - ID3v2.3.0 informal standard,
id3.org/id3v2.3.0(frame layout, the TCON genre frame and its "(number)" references to ID3v1 genres). - ID3v2.4.0 structure and frames documents,
id3.org/id3v2.4.0-structureandid3.org/id3v2.4.0-frames(several values in one text frame, separated by a null character). - Vorbis I specification, comment header section,
xiph.org/vorbis/doc/v-comment.html(FIELD=value comments, case-insensitive field names, repeatable fields). - IETF RFC 9639, "Free Lossless Audio Codec (FLAC)", 2024 (FLAC metadata blocks; block type 4 holds the Vorbis comments).