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: the Winamp text’s own example lists
http://www.site.com:8000/listen.pls, a SHOUTcast stream, as an entry.
How a relative entry is resolved
The format itself does not say: Gonze’s survey calls relative paths “with the base undefined by the file format”. The Winamp text gives the practice: “Alternative and Classical are sub-directories of the directory that this playlist is stored in”, and “crap.mp3” is in the same directory. The open players agree:
- mpv joins the entry to the directory part of the playlist’s
address, for everything that is not a URL (
pl_addindemux_playlist.c). - VLC treats the playlist’s own address as a URL base and resolves
the entry against it as a URI reference (
ProcessMRL). It first repairs an entry that is not a legal URI: a space or a non-ASCII character is percent-encoded. On Windows an entry that starts with a drive letter and a colon, or with\\, is taken as an absolute file path. It warns that a path containing%,:,#or?can be misread as a URL. - Audacious builds a location from the entry and the playlist’s
file name (
uri_construct). - HLS states the rule: “Any relative URI is considered to be relative to the URI of the Playlist that contains it” (RFC 8216 section 4.1), which is the reference resolution of RFC 3986 section 5.
A playlist moved to another folder therefore breaks its relative entries, and an absolute path breaks on another system; a URL works anywhere. The viewer sorts each entry into relative path, absolute Windows path, network path, absolute Unix path or URL, and flags a URL with a character RFC 3986 does not allow.
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.
What readers do with the bytes
Nothing in a plain .m3u file says which encoding it uses, so every
reader guesses (Wikipedia: the system code page “is usually assumed for .m3u but this
is often UTF-8 as well nowadays”). The source of the open players shows the guesses:
| Reader | What it does |
|---|---|
VLC (m3u.c) | A UTF-8 byte order mark, or the name .m3u8, means UTF-8 only: a line that is not valid UTF-8 is dropped. Otherwise a line that is valid UTF-8 is read as UTF-8, and any other as ISO 8859-1 (Latin-1). |
mpv (demux_playlist.c) | Skips a byte order mark and reads UTF-16 (either byte order) when one says so. Every line then has its character set guessed (mp_charset_guess, with the player’s metadata code page option, meta_cp, as a hint) and, when it is not UTF-8, is converted to UTF-8. A line with a NUL, or longer than its buffer, is an error. |
Audacious (m3u.cc) | Skips a UTF-8 byte order mark and splits at LF, removing a CR before it. It does not convert the text. |
| The explorer | Reads a UTF-8 or UTF-16 byte order mark; otherwise UTF-8 when the bytes are valid UTF-8, and Windows-1252 when they are not. It reports a .m3u8 file that is not valid UTF-8, and says what was assumed. |
Line endings: Audacious and mpv split at LF; neither mentions a lone CR. The explorer reports a lone CR and a file that mixes line endings.
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. VLC is looser: it
takes a file that begins #EXTM3U, or that is named .m3u,
.m3u8 or .vlc, or whose HTTP media type is one of the M3U
types below, or whose first lines hold an address that starts http://,
https://, mms://, rtsp:// or ftp://,
or that begins RTSPtext (a QuickTime redirect file). The explorer claims a
file by its name (.m3u, .m3u8, .vlc) or by
#EXTM3U on the first line.
| Media type | Status |
|---|---|
application/vnd.apple.mpegurl | Registered with IANA (Wikipedia gives 2009), for HLS; the registration cites the HLS specification. The IANA application and audio lists, read in November 2026, hold no other M3U type. |
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. |