M3U File Documentation
Summary
An M3U Media Playlist is a plain-text file that lists audio or video items to play in order, one file path or URL per line. It stores no media of its own, only pointers to it, which is why tracks go “missing” when the referenced files move. The extension is .m3u and its MIME type is audio/x-mpegurl. Open it in a player like VLC, or in any text editor to fix paths.
Technical details
| Feature | Value |
|---|---|
| Full name | M3U Media Playlist (MP3 URL) |
| File extension | .m3u |
| MIME type | audio/x-mpegurl (also audio/mpegurl) |
| M3U8 MIME type | application/vnd.apple.mpegurl |
| Format type | Plain-text playlist (list of paths/URLs) |
| Contains media | No — references only |
| Developer | Nullsoft (Winamp) |
| Introduced | Late 1990s |
| Character encoding | Local/ANSI codepage (.m3u8 sibling is UTF-8) |
| Open standard | No — the HLS variant is standardised as RFC 8216 |
| Directive marker | #EXTM3U (first line of an Extended M3U) |
| Common directives | #EXTM3U, #EXTINF, #EXTGRP |
| HLS tags | #EXT-X-STREAM-INF, #EXT-X-TARGETDURATION, #EXT-X-ENDLIST |
| Comment prefix | # |
| Line format | One media path or URL per line |
| Category | Audio / video playlist (incl. IPTV, HLS) |
| Related extensions | .m3u8, .pls, .xspf, .wpl, .cue |
| Editable as text | Yes — any text editor |
| Typical openers | VLC, Winamp, foobar2000, mpv |
What is an M3U file?
An M3U file is a plain-text playlist: a list of media items to play in order, written one entry per line. Each entry is a file path or a web URL that points at audio or video sitting somewhere else. The file itself holds no music and no video, only directions to it. Nullsoft created the format for the Winamp player in the late 1990s, and the name is usually read as “MP3 URL”. It became the default playlist format on Windows and spread from there.
Because the playlist is just a set of pointers, an .m3u stays tiny (a few kilobytes even for hundreds of tracks) and it breaks the moment the referenced files are moved, renamed, or missing from the device. This is the single most common source of confusion with the format: when someone says “my M3U plays but the songs won’t start”, the playlist is almost always intact and the paths inside it no longer resolve. Fixing the file means fixing the paths, not the audio.
The two flavours: basic M3U and Extended M3U
There are two shapes an M3U can take. A basic M3U is nothing but a list of locations, one per line, with no metadata at all:
Song1.mp3
Song2.mp3
..\Albums\Live\track03.mp3
https://stream.example.com/radio.mp3
A player reads these top to bottom and plays whatever each line resolves to. It has no way to show a track’s name or length until it opens the file, because none of that is written down.
An Extended M3U fixes that. It begins with the literal line #EXTM3U and precedes each entry with an #EXTINF line that carries the duration and a display title:
#EXTM3U
#EXTINF:213,Aphex Twin - Xtal
Music\Aphex Twin\Xtal.mp3
#EXTINF:-1,Example FM - Live
https://stream.example.com/radio.mp3
The two forms are otherwise identical, and most software written since the 2000s emits the extended form. A player that does not understand #EXTM3U simply treats those lines as comments (they start with #) and still plays the paths, so extended files stay backward compatible.
The #EXTINF directive, dissected
The #EXTINF line is where an Extended M3U stores per-track metadata. Its grammar is #EXTINF:duration,title. The duration is given in seconds as an integer; a value of -1 means the length is unknown or unbounded, which is what you use for live radio and IPTV streams that never end. After the comma comes the display title, conventionally written as Artist - Title, though it is free text and players show it verbatim.
The comma matters: everything before it is parsed as the duration (plus any attributes), everything after it is the label. This is why a title that itself contains a comma is still handled correctly, the split happens on the first comma only. The practical payoff is that a player can populate a playlist window with names and running times without opening a single media file, which is fast even for a list of a few thousand entries.
Encoding and the m3u / m3u8 split
An .m3u and an M3U8 file are the same format with one difference: text encoding. A classic .m3u is saved in the machine’s local ANSI codepage (Windows-1252, for example), while an .m3u8 is the same content saved as UTF-8 — the “8” in the extension is literally UTF-8.
The distinction is invisible as long as every path uses plain Latin letters. It stops being invisible the moment a channel name or filename contains Arabic, Chinese, Cyrillic, or accented characters. Saved as ANSI, those bytes are ambiguous and a player on a different system renders them as garbled text; saved as UTF-8, they survive intact on any platform. That reliability is a large part of why UTF-8 M3U8 became the manifest format for streaming rather than the older ANSI M3U.
HLS and the extended tag set
M3U8 is the manifest format for Apple HTTP Live Streaming (HLS), standardised as IETF RFC 8216 in 2017. HLS reuses the M3U comment-directive convention (#EXT-...) and adds a set of #EXT-X- tags for adaptive streaming.
HLS uses two layers of playlist. A master (multivariant) playlist lists the available quality variants, each with a bitrate and resolution, using #EXT-X-STREAM-INF:
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
low/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2400000,RESOLUTION=1280x720
mid/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=6000000,RESOLUTION=1920x1080
high/index.m3u8
The client picks a variant based on available bandwidth and can switch between them as conditions change. Each variant URL points to a media playlist, which lists the actual short media segments to fetch in sequence:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000,
segment0.ts
#EXTINF:6.000,
segment1.ts
#EXTINF:6.000,
segment2.ts
#EXT-X-ENDLIST
Here #EXT-X-TARGETDURATION declares the maximum segment length, #EXT-X-MEDIA-SEQUENCE numbers the first segment (it advances in a live stream as old segments drop off), each #EXTINF gives one segment’s exact duration, and #EXT-X-ENDLIST marks a finished (video-on-demand) playlist. A live stream omits #EXT-X-ENDLIST and the client keeps re-fetching the media playlist for new segments. IPTV channel lists are built on exactly this machinery.
Relative paths, absolute paths, and directive lines
Entries can be written as relative paths (resolved against the playlist’s own folder, e.g. Music\track.mp3 or ..\shared\clip.mp4) or as absolute paths and URLs (C:\Media\track.mp3, https://host/stream.m3u8). Relative paths keep a playlist portable as long as it travels together with its media in the same folder layout; absolute paths pin the playlist to one machine and break as soon as the drive letter, mount point, or user folder differs. This is the mechanical reason playlists “stop working” after copying them to another computer or phone.
Every line beginning with # is a comment or directive and is never treated as a media entry. Beyond #EXTM3U and #EXTINF, IPTV lists commonly use #EXTGRP: to assign a channel to a group (Sports, News, Movies) so players can organise a large channel list into categories. Other players and exporters add their own # tags; anything a given player does not recognise is safely ignored.
Related playlist formats
M3U is not the only playlist container. PLS is an INI-style playlist that Winamp and SHOUTcast also use, with numbered FileN= and TitleN= keys instead of bare lines. XSPF (“spiff”) is an open XML playlist format built for interoperability. A CUE sheet is a different animal: rather than pointing at many separate files, it indexes track boundaries inside one long audio file, which is common for ripped CDs and DJ mixes. M3U wins on ubiquity and on being trivially editable in a text editor, which the XML- and INI-based formats are less friendly for.
FAQ
Why does the same list show garbled names as .m3u but read correctly as .m3u8?
Because the two extensions imply different text encodings. A .m3u is interpreted in the local ANSI codepage, so bytes for non-Latin characters are misread on any system whose codepage differs. The identical bytes saved as .m3u8 are read as UTF-8, which encodes those characters unambiguously. Re-saving the file as UTF-8 (and using the .m3u8 extension) fixes the garbling; no media is touched.
What does #EXTINF:-1 mean?
The duration field is -1 when the length is unknown or infinite. It is the standard value for live radio, live TV, and IPTV entries, which have no fixed end. A player shows such an entry without a running time and simply plays until you stop it or the stream drops.
References
- Wikipedia — M3U (format, #EXTM3U, M3U8 and UTF-8)
- Apple — HTTP Live Streaming (HLS)
- IETF — RFC 8216: HTTP Live Streaming
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.