HLS playlist tag reference
Every line in an m3u8 playlist that starts with #EXT is a tag. Tags beginning with #EXT-X- are HLS-specific; #EXTINF is inherited from the M3U format. Lines beginning with a single # are comments, and any other non-empty line is interpreted as a URI.
Basic playlist tags
| Tag | Meaning |
#EXTM3U | Must be the first line. Identifies the file as an extended M3U playlist. |
#EXT-X-VERSION:n | Compatibility version. Higher versions unlock newer tags but exclude older players. |
#EXT-X-TARGETDURATION:n | Maximum segment duration in seconds, rounded up. Required in every media playlist. |
#EXT-X-MEDIA-SEQUENCE:n | Sequence number of the first segment. Important for live sliding windows. |
#EXTINF:duration,[title] | Duration of the segment URI on the following line. |
#EXT-X-ENDLIST | No more segments will be added. Present for VOD, absent for live. |
#EXT-X-PLAYLIST-TYPE:VOD / EVENT | Declares whether the playlist is immutable or append-only. |
#EXT-X-DISCONTINUITY | Encoding parameters change at this point (e.g. an ad break with a different resolution). |
#EXT-X-PROGRAM-DATE-TIME | Absolute wall-clock timestamp for the following segment; used for sync and analytics. |
Master playlist tags
| Tag | Meaning |
#EXT-X-STREAM-INF | Describes the variant URI below. Attributes include BANDWIDTH, RESOLUTION, CODECS, FRAME-RATE and AUDIO/VIDEO group IDs. |
#EXT-X-MEDIA | Declares alternative renditions such as audio languages or subtitle tracks. |
#EXT-X-I-FRAME-STREAM-INF | Points to an I-frame-only playlist used for fast trick-play and thumbnails. |
#EXT-X-SESSION-KEY | Encryption key applicable to all variants in the session. |
Encryption and low latency
| Tag | Meaning |
#EXT-X-KEY | Specifies METHOD (AES-128, SAMPLE-AES, NONE), the key URI and optional IV. |
#EXT-X-MAP | Points to the initialisation segment required by fMP4/CMAF segments. |
#EXT-X-PART / #EXT-X-PART-INF | Low-Latency HLS partial segments; lets players start before a full segment exists. |
#EXT-X-SERVER-CONTROL | Advertises LL-HLS capabilities such as CAN-BLOCK-RELOAD and hold-back values. |
#EXT-X-DEFINE | Variable substitution, useful for templated playlist delivery. |
A master playlist example
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English",DEFAULT=YES,URI="audio/en.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360,CODECS="avc1.4d401e,mp4a.40.2",AUDIO="aac"
video/360p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2400000,RESOLUTION=1280x720,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="aac"
video/720p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080,CODECS="avc1.640028,mp4a.40.2",AUDIO="aac"
video/1080p.m3u8
The player starts with the variant that best matches available bandwidth, then moves up or down. Accurate BANDWIDTH values matter more than the order of variants.
Validation checklist
#EXTM3U is literally the first line, with no BOM and no leading blank line.
- Every
#EXTINF duration is ≤ #EXT-X-TARGETDURATION.
- Live playlists do not contain
#EXT-X-ENDLIST.
- Relative URIs resolve correctly after any redirects.
- Playlist is served as UTF-8 with the correct MIME type and CORS headers.
Related reading