There is no formal specification for M3U. The format began with Fraunhofer’s WinPlay3 player around 1996 and spread by being copied, so this page describes common practice. Only the variant used for streaming video has a real specification, in RFC 8216, and that one has its own page. Where RFC 8216 is stricter than ordinary M3U, this page says so.
Simple and extended forms
| Form | First line | Contents |
|---|---|---|
| Simple M3U | Any entry or comment | One entry per line. Comments are ignored. |
| Extended M3U | #EXTM3U | The same entries, with directives on the lines in front of them. |
A reader that knows nothing about directives can still play an extended file,
because every directive begins with # and is therefore a comment to it.
C:\Music\First Song.mp3
Second Song.mp3
https://radio.example.com/stream
Line types
| Line | Meaning |
|---|---|
| Blank | Ignored. |
Starts with #EXT | A directive in an extended playlist, or a comment to a reader that does not know it. |
Other line starting with # | A comment, ignored. |
| Anything else | An entry: the path or URL of an item to play. |
Entries
An entry may be an absolute path, a path relative to the playlist’s own folder, or a URL. Path separators follow the operating system that wrote the file, so a playlist with Windows paths and backslashes does not travel well to other systems, while URLs do. An entry can also name another playlist, which some players follow. The format does not define how relative paths are resolved; players use the playlist’s folder, and some resolve a playlist fetched over HTTP against its URL. RFC 8216 requires that for HLS.
Text encoding and line endings
| Extension | Encoding |
|---|---|
.m3u | The system’s default non-Unicode encoding, so a file may be unreadable elsewhere. Nothing in the file says which encoding it uses. |
.m3u8 | UTF-8. |
Lines end in LF or CR LF. Some devices require CR LF and do not recognise a bare LF. RFC 8216 allows both, requires UTF-8 without a byte order mark, and forbids control characters other than CR and LF, but only for HLS.
Recognising an M3U file
A simple M3U has no signature. An extended one begins with #EXTM3U.
Readers therefore lean on the file’s name; mpv, for example, only accepts a playlist
without the header if its extension is m3u, m3u8 or
strm. Tags are case-sensitive in mpv and in RFC 8216.
| Media type | Status |
|---|---|
application/vnd.apple.mpegurl | Registered with IANA in 2009, for HLS. |
audio/mpegurl | Unregistered but accepted by RFC 8216 for HLS, and recommended by an early survey of playlist formats. |
application/mpegurl, application/x-mpegurl, audio/x-mpegurl | Unregistered, in common use. |
An extended playlist, line by line
#EXTM3U
#EXTINF:215,Artist Name - First Song
Music/First Song.mp3
# A comment that every reader skips
#EXTINF:-1,Internet Radio
https://radio.example.com/stream
| Line | Type | Meaning |
|---|---|---|
| 1 | Header | Marks an extended playlist. Must be the first line. |
| 2 | Directive | The next item lasts 215 seconds and is titled “Artist Name - First Song”. |
| 3 | Entry | A path relative to the playlist. |
| 4 | Comment | Ignored. |
| 5 | Directive | The next item has no set length. |
| 6 | Entry | A stream URL. |