The M3U (.m3u) Playlist File Format (December 2001, Revised June 2007 <email@example.com>)
Preface: Since this page became the biggest reference to the M3U playlist on the internet I thought it was about time to expand on it and answer some of the questions that I get asked regularly.
This page used to be very short and just gave the basic mechanics when I wrote it in 2001, but here is a more fleshed-out version with more than just a format.
Q & A
* What is an “M3U File”?
M3U is a media queue format, also generally known to humans as a playlist. It is the default playlist save format of WinAMP and most other media programs. It allows multiple files to be queued in a program in a specific format.
In plain english it is exactly as it sounds — a list of what will be played, like a set list at a concert.
* Did you invent the M3U playlist?
No. I think it was invented by Justin Frankel of Winamp fame, but I have no confirmation about this.
* What is the format (syntax) of an M3U playlist?
The actual format is really simple, though; not complicated at all. A sample M3U list could be:
1234567891011 #EXTM3U#EXTINF:111,3rd Bass - Al z A-B-Cee zmp3/3rd Bass/3rd bass - Al z A-B-Cee z.mp3#EXTINF:462,Apoptygma Berzerk - Kathy�s song (VNV Nation rmx)mp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song (Victoria Mix by VNV Nation).mp3#EXTINF:394,Apoptygma Berzerk - Kathy's Songmp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song.mp3#EXTINF:307,Apoptygma Bezerk - Starsignmp3/Apoptygma Berzerk/Apoptygma Berzerk - Starsign.mp3#EXTINF:282,Various_Artists - Butthole Surfers: They Came Inmp3/Butthole_Surfers-They_Came_In.mp3
The First line, “#EXTM3U” is the format descriptor, in this case M3U (or Extended M3U as it can be called). It does not change, it’s always this.
The second and third operate in a pair. The second begins “#EXTINF:” which serves as the record marker. The “#EXTINF” is unchanging. After the colon is a number: this number is the length of the track in whole seconds (not minutes:seconds or anything else. Then comes a comma and the name of the tune (not the FILE NAME). A good list generator will suck this data from the ID3 tag if there is one, and if not it will take the file name with the extension chopped off.
The second line of this pair (the third line) is the actual file name of the media in question. In my example they aren’t fully qualified because I run this list by typing “noatun foo.m3u” in my home directory and my music is in ~/mp3, so it just follows the paths as relative from the path of invocation.
* I want to pull the music out of an M3U file, how do I do it?
You really can’t, not out of the file itself. The M3U file is just a list of other files and doesn’t store any of the music or sound information inside itself. You can read the M3U file and then see which files are listed and get the music from those, however — if you can find those files that is.
* The M3U file is so small, how can all that music fit?
The M3U file is a list of MP3 files, “pointers” to use the programmers term, but doesn’t contain any of the sound data itself.
* Can I see what files are listen in an M3U file without opening it with my MP3 playing program?
Yes. M3U files are really just “text” files which means that they can be viewed by people as well as computers. To see what an M3U file contains you can open it with a text editing program like “Notepad” in Windows or “textedit” in Macintosh. Some of the information may not make sense, but the list of MP3 files will be easy to spot.
* I moved an M3U to another place on my computer and now it won’t play.
A lot of times the paths to the MP3 files in an M3U are “relative”, that means they look for the MP3 files in relation to where the M3U file lives. Example:
If I had an M3U in the following location on my hard drive:
…and it contained path to an MP3 like:
… my MP3 playing program is really looking for that file in:
… so if I move the M3U file to:
… all of the sudden my MP3 program will be looking for the MP3 file in:
… which probably doesn’t exist and so it won’t play.
This is not always the reason a file won’t play, but if the file is there and all of the sudden the M3u won’t play it it is likely the reason.