Technical reference
M3U Playlist Format Reference: Tags, URLs & EPG
Use this reference when you need to read, create, or troubleshoot an M3U playlist. It explains the common playlist structure and metadata you are likely to encounter, while separating the playlist format from the media service and access rights behind it.
The basic M3U structure
An M3U playlist is plain text. A common extended playlist begins with #EXTM3U, followed by one or more item descriptions and the media locations those descriptions refer to.
The playlist is an index, not the media itself. A player parses the text first and then attempts to open each referenced location.
#EXTM3U
#EXTINF:-1,Sample documentary
https://media.example.org/authorized/sample-documentary.mp4What #EXTM3U means
#EXTM3U is commonly used as the extended-playlist header. It signals that the file uses the extended M3U form and may contain metadata lines such as #EXTINF.
The header does not make a source public or grant permission to access the media referenced later in the file.
What #EXTINF means
#EXTINF describes the media item that follows. In the common form, it contains a duration value and a display name. IPTV-oriented playlists may add attributes after the duration to provide channel metadata.
#EXTINF:-1,Sample channel
https://media.example.org/authorized/channel.mp4Common IPTV playlist metadata
IPTV playlists often include metadata attributes that help a player label and organize channels. Support varies by player, so treat these attributes as playlist conventions rather than universal requirements.
- tvg-id: a channel identifier commonly used to associate a channel with programme-guide data.
- tvg-name: a display or matching name for the channel.
- tvg-logo: a URL or reference used by supporting players for channel artwork.
- group-title: a category or group label used to organize entries.
#EXTINF:-1 tvg-id="sample.example" tvg-name="Sample Channel" tvg-logo="https://media.example.org/logo.png" group-title="News",Sample Channel
https://media.example.org/authorized/channel.mp4The media URL comes after the metadata
In the common extended-playlist pattern, the media location appears on the line after the #EXTINF entry. It may be a local path or a remote URL that the player is authorized to access.
If the playlist loads but playback fails, test the media location separately. Parsing the playlist and retrieving the media are different stages.
M3U and EPG data are separate layers
An M3U playlist can identify channels while an electronic programme guide supplies programme metadata. A player may connect the two using a channel identifier or another documented matching field.
An M3U file does not automatically contain a complete EPG. Check the playlist, player, and EPG provider documentation to see how programme data is connected.
M3U vs M3U8
M3U8 identifies an M3U-style playlist encoded as UTF-8. It is also widely used by HTTP Live Streaming, where playlists contain HLS-specific tags and rules. Changing a file extension does not convert its contents or encoding.
M3U file vs M3U URL
The same playlist text can be stored locally as a file or delivered by a URL. A URL is simply a way for a compatible client to retrieve playlist data; it does not change the underlying playlist semantics.
Standard syntax vs IPTV metadata conventions
M3U is a playlist format, but not every field found in IPTV playlists is part of one universal M3U specification. The core playlist pattern is simple; attributes such as tvg-id, tvg-name, tvg-logo, and group-title are commonly used by IPTV software as metadata conventions.
This distinction matters when building parsers or troubleshooting compatibility: a player may understand the basic playlist structure while ignoring a metadata attribute it does not support.
- Core structure: playlist header, item metadata, and the media location that follows it.
- Common IPTV metadata: tvg-id, tvg-name, tvg-logo, and group-title.
- Player behavior: metadata support varies, so unsupported attributes may be ignored.
- HLS M3U8: uses additional protocol-specific tags and rules defined by the HLS specification.
M3U attribute reference: tvg-id, tvg-name, tvg-logo, group-title & EPG
The attributes below are common in IPTV-oriented M3U playlists, but they are conventions rather than a single universal metadata schema. A parser should treat them as optional fields and follow the target player's documented support.
The safest mental model is layered: first parse the core playlist structure, then parse metadata attributes, then connect channel identity to EPG data when the player supports that workflow.
- tvg-id: commonly identifies a channel and can be used to match playlist entries to EPG channel IDs.
- tvg-name: commonly supplies a channel name used for display or matching.
- tvg-logo: commonly points to channel artwork or a logo resource.
- group-title: commonly assigns an entry to a display group or category.
- tvg-country and tvg-language: commonly provide country or language metadata where supported.
- url-tvg and x-tvg-url: commonly appear as playlist-level references to EPG/XMLTV data, but support and naming vary by player or source.
- #EXTGRP: a group directive used by some playlist implementations to organize entries.
#EXTM3U url-tvg="https://guide.example.org/authorized.xml"
#EXTINF:-1 tvg-id="sample.example" tvg-name="Sample Channel" tvg-logo="https://media.example.org/logo.png" group-title="News" tvg-country="US" tvg-language="en",Sample Channel
https://media.example.org/authorized/channel.mp4Classify playlist fields by layer
Not every tag or attribute has the same status. Keeping the layers separate prevents a parser from treating a player-specific extension as if it were core M3U syntax, and prevents an EPG reference from being mistaken for the media stream itself.
- Core playlist structure: #EXTM3U, #EXTINF, and the media URL or path that follows an item description.
- Common IPTV convention: tvg-id, tvg-name, tvg-logo, group-title, tvg-country, and tvg-language.
- EPG relationship: tvg-id can correspond to an XMLTV channel id; url-tvg or x-tvg-url may point to guide data when supported.
- HLS-specific: #EXT-X-* tags belong to the HTTP Live Streaming playlist syntax, not generic IPTV channel metadata.
- Player-specific: directives such as #EXTVLCOPT:* depend on the consuming application and should not be assumed portable.
How tvg-id connects M3U entries to XMLTV
When a player uses tvg-id for EPG matching, the value needs to correspond to the channel identifier exposed by the EPG source. The exact matching rules depend on the player and EPG implementation.
A channel name that looks identical is not necessarily a reliable match key: identifiers can remain stable while display names change, and different sources may use different naming conventions.
- Inspect the playlist's tvg-id value.
- Inspect the corresponding XMLTV channel id.
- Confirm the player documents tvg-id or an equivalent mapping convention.
- Check timezone and programme coverage separately after channel identity matches.
URL-tvg, x-tvg-url, and guide references
Playlist-level EPG references are commonly written with names such as url-tvg or x-tvg-url. These names are widely encountered in IPTV tooling, but they should not be treated as universally standardized M3U attributes. Verify the exact syntax accepted by the target player or source.
The guide URL points toward programme metadata; it does not replace the channel or media entries in the playlist. A valid EPG reference can still produce an empty guide if channel identifiers do not match.
Player-specific extensions
Some players accept application-specific directives such as #EXTVLCOPT:* to influence playback behavior. These can be useful in a controlled workflow, but they are not portable M3U metadata just because one player recognizes them.
When building or sharing a playlist, keep player-specific extensions isolated and document the target client so another parser does not silently interpret them as generic fields.
Developer compatibility checklist
When implementing an M3U parser or integrating playlist support, treat the basic playlist structure separately from optional metadata. Preserve unknown attributes where practical, parse quoted values carefully, and test against real playlists from the systems you intend to support.
- Accept the extended playlist header when your implementation supports extended M3U.
- Associate each item metadata line with the media location that follows it.
- Do not assume every IPTV metadata attribute is mandatory.
- Do not treat a filename extension alone as proof of HLS semantics.
- Test non-ASCII channel names when UTF-8 input is expected.
Example: parsing the layers separately
A useful mental model is to parse a playlist in layers: first recognize the playlist structure, then extract optional metadata, then hand the resulting media location to the playback layer. This makes errors easier to isolate and avoids treating metadata problems as media-access problems.
#EXTM3U
#EXTINF:-1 tvg-id="sample.example" tvg-name="Sample Channel" group-title="News",Sample Channel
https://media.example.org/authorized/channel.mp4Validation checklist
When a playlist fails, validate one layer at a time instead of changing the file, player, network, and source simultaneously.
- Confirm the file is plain text and begins with the expected playlist header when using the extended form.
- Check that each metadata line is followed by the media location it describes.
- Check URLs for truncation, spaces, expired credentials, or other source-specific changes.
- Confirm the player supports the playlist metadata and media protocol being used.
- If EPG data is expected, verify the EPG source and channel identifiers separately.
- Keep a small known-good sample so formatting problems can be isolated from source or network failures.
Further reading
Sources and documentation
Quick answers
Common questions
What is the basic structure of an M3U playlist?
A common extended M3U playlist starts with #EXTM3U, then uses #EXTINF metadata followed by the media location for each item.
What does #EXTINF mean in an M3U file?
#EXTINF commonly describes the following media item, including its duration and display name. IPTV playlists may add metadata attributes that compatible players can use.
What is tvg-id used for?
tvg-id is commonly used as a channel identifier so playlist entries can be matched with programme-guide data when the player and EPG source support that convention.
Does an M3U playlist include EPG data?
Not necessarily. Playlist entries and programme-guide data are separate layers unless the player and playlist explicitly connect them.
Can I use this format reference for any IPTV playlist?
Use it as a practical reference for common M3U conventions, but check the documentation for the specific player, playlist provider, and metadata conventions because support can vary.
