An M3U8 file is basically a playlist, but not the Spotify kind…
It’s a tiny UTF-8 text file that tells the video player where to find the actual media. Instead of containing the video itself, it acts like a roadmap:
When you stream over HLS, the player constantly reads this file to decide what to play next, which quality to switch to, and how to manage the live buffer.
Think of it as the brains behind how your video arrives smoothly, even when your network doesn’t cooperat
Now a proper technical definition
An M3U8 file is a UTF-8 encoded version of the M3U playlist format used primarily in HTTP Live Streaming (HLS). It contains a structured list of media segment URLs, metadata tags, and optional variant playlists. M3U8 files do not store video or audio content; instead, they reference media files or other playlists, allowing video players to fetch and assemble segmented media for adaptive streaming across varying network conditions.
If you’ve ever opened an M3U8 file expecting something “video-like,” you’ll be surprised. There’s no video inside, just a structured text file that quietly orchestrates how your stream behaves. It’s simple on the surface, but it carries the instructions that let HLS streaming work reliably across devices and networks.
At a high level, an M3U8 file combines two things: media file references and metadata tags. Together, they help the player understand what to load, in what order, and how long each segment lasts.
These are the actual URLs or paths to your media segments. The playlist doesn’t embed video; it just points to each piece.
When a player sees:
segment1.ts
segment2.ts
segment3.ts
…it fetches those files one by one, buffers them, and pieces them together during playback. This design is what allows HLS to work well even on unstable networks, players always know exactly what to request next. If you're testing segments locally or in your app, you can plug these directly into any player, such as HLS.js using our player SDK tutorials.
Every meaningful instruction in an M3U8 file starts with #EXT. These tags describe everything the player needs to know: segment duration, sequence order, version compatibility, whether the stream is live or finished, and more. For a full breakdown of these tags, see our Complete HLS Tags guide
Here’s what a basic M3U8 playlist looks like:
1#EXTM3U
2#EXT-X-VERSION:3
3#EXT-X-TARGETDURATION:10
4#EXT-X-MEDIA-SEQUENCE:1
5#EXTINF:10.0,
6segment1.ts
7#EXTINF:10.0,
8segment2.ts
9#EXTINF:10.0,
10segment3.ts
11#EXT-X-ENDLIST
Even without context, you can see the story it’s telling:
#EXTM3U
Identifies the file as an M3U playlist. This must always be the first line.
#EXTINF
Specifies how long the next media segment lasts. Without this, the player has no timeline.
#EXT-X-TARGETDURATION
Indicates the maximum segment duration allowed in the playlist. HLS players rely on this for buffer management.
#EXT-X-MEDIA-SEQUENCE
Defines which segment number the playlist starts with. Essential for live streams where segments keep rotating.
#EXT-X-ENDLIST
Marks the end of the playlist. If it’s missing, the player assumes the stream is live and more segments might arrive.
An M3U8 file combines media URIs and metadata tags that describe how to fetch and assemble segmented video during playback. Tags such as #EXTINF, #EXT-X-TARGETDURATION, and #EXT-X-MEDIA-SEQUENCE help the HLS client manage sequence order, buffering, segment duration, and playback state. This structure is what enables adaptive, reliable streaming across devices and network conditions.
M3U8 files sit quietly behind most modern streaming experiences. Whether you’re watching a live sports match, binging a show, or jumping between quality levels on a shaky network, there’s almost always an M3U8 playlist doing the heavy lifting.
Here’s where they matter most.
For live streams, M3U8 files act as a constantly updating playlist.
As new segments of the live broadcast are produced, the playlist refreshes to point to the latest ones. Players simply follow the list, segment by segment, to stay in sync with the live feed.
This allows live streams to run without packaging the entire content ahead of time, everything is served in near real time.
For VOD, an M3U8 file lists all the pre-recorded segments in order.
Once the player reaches the end of the playlist, it stops, because the file includes an #EXT-X-ENDLIST tag telling the player, “That’s it, we’re done here.”
This makes M3U8 a great fit for:
This is where M3U8 and HLS really shine. With adaptive bitrate streaming, multiple playlists exist, each representing a different quality level (1080p, 720p, 480p, etc.).
A master playlist ties them all together. As network conditions change, the player switches between these variant playlists seamlessly. If you want to understand ABR deeper, read our blog to understand it better.
This is why:
All of this intelligence flows from the way M3U8 files are structured.
M3U8 files power live, on-demand, and adaptive bitrate streaming by listing media segments in order and providing the metadata a player needs to fetch, buffer, and play them correctly. In live workflows, the playlist keeps updating with new segments. In VOD, it’s a fixed list from start to finish. And in adaptive streaming, multiple playlists work together so the player can switch quality levels based on the viewer’s network.
If you’re exploring how to implement VOD or live streaming in your own product, At FastPix we support both workflows end-to-end. You can take a look at our Live and VOD guides.
HLS (HTTP Live Streaming) is built around the idea of breaking video into small, time-based chunks. Instead of sending a single large file, the server creates short segments, usually 6 to 10 seconds each, and the M3U8 playlist tells the player exactly where those segments live.
This setup gives HLS its biggest strengths: stability, adaptability, and compatibility across devices.
The master playlist is an M3U8 file that points to multiple variant playlists.
Each variant represents a different bitrate and resolution, like 1080p, 720p, or 360p.
A simplified example:
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=1280x720
high_quality.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=854x480
medium_quality.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=400000,RESOLUTION=640x360
low_quality.m3u8
Each variant comes with its own media playlist. This playlist contains the actual segments usually short .ts files along with their durations. A typical structure looks like this:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXTINF:10.0,
segment1.ts
#EXTINF:10.0,
segment2.ts
#EXTINF:10.0,
segment3.ts
In a live stream, this playlist keeps updating as new segments are produced. For VOD, the playlist ends with #EXT-X-ENDLIST, telling the player that the content is complete.
If you're planning to build your own player or test HLS playback directly inside an app, you can follow our platform-specific guides below:
These walkthroughs show how to load HLS playlists, manage buffering, handle adaptive switching, and add your own UI on top of the media playlist.
These are the real pieces of media. Because each chunk is short, player scan:
This segmented approach is also why HLS works so reliably even on mobile networks.
By combining a master playlist with multiple media playlists, HLS lets the player adjust the stream on the fly.
If the viewer’s network improves jump to a higher bitrate.
If it drops: scale down instantly.
The player makes these decisions in real time based on the bandwidth and buffer state.
HLS uses M3U8 playlists to map out every part of the stream, from segment order to bitrate variations.
The master playlist provides all possible qualities, the media playlists list the actual segments, and the player picks the best path based on real-time conditions. This architecture makes HLS a dependable choice for both live streaming and VOD.
Once you understand what an M3U8 playlist does, the next question is usually:
“Great… but how do I actually create one?”
The good news is you don’t need to build these files line-by-line (unless you personally enjoy staring at timestamps in a text editor).
Most developers rely on tools that automatically generate and maintain M3U8 playlists as part of their encoding or packaging process.
Here are the most common options used across streaming workflows.
FFmpeg
FFmpeg is the multi-tool of video processing. It can generate HLS playlists, cut segments, convert formats, and pretty much handle anything you throw at it.
A basic command to create an HLS playlist looks like this:
ffmpeg -i input.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls playlist.m3u8
This takes an MP4 file, splits it into 10-second segments, and produces a clean M3U8 playlist.
It’s fast, reliable, and widely used in production environments.
VLC Media Player
VLC isn’t just for watching videos. You can open M3U8 files directly in VLC to inspect how a playlist behaves in real time. It’s a quick way to confirm that your playlist is valid before pushing it into a larger workflow.
Shaka Player
Shaka Player is an open-source JavaScript player that supports both HLS and DASH. It’s especially useful when testing your M3U8 playlists in the browser or building your own player UI. Developers like it because everything is transparent and easy to debug.
HLS.js
Many browsers (especially older or non-Safari ones) don’t support HLS playback natively. HLS.js fills that gap by parsing HLS segments in JavaScript and passing them to the Media Source Extensions (MSE) API. If you’re streaming HLS in the browser, this library becomes essential.
Tools like FFmpeg, VLC, Shaka Player, and HLS.js help you create, test, and debug M3U8 files at different stages of your workflow.
Each tool serves a specific purpose, encoding, previewing, validating, or enabling browser playback. In most modern setups, playlists are generated automatically as part of an encoding pipeline or through a video API service.
If you ever need to create an M3U8 playlist manually, maybe for testing, troubleshooting, or learning how HLS works, you’ll see that the structure is surprisingly straightforward. An M3U8 file is just a UTF-8 text file with a series of tags and segment references arranged in a specific order.
Here’s how to build one from scratch.
1. Open a text editor
Any text editor that supports UTF-8 encoding works fine, VS Code, Sublime, Notepad++, anything. M3U8 files are simply .m3u8 text files.
2. Add the required metadata tags
Every playlist starts with #EXTM3U.
After that, you define the version, target duration, and any other essential metadata.
For example:
1#EXTM3U
2#EXT-X-VERSION:3
3#EXT-X-TARGETDURATION:10
These tags tell the player what HLS version to follow and how long each segment is expected to be.
3. List your media segments
For each segment, you add an #EXTINF tag (which defines the duration) followed by the name or URL of the segment.
Example:
segment1.ts
#EXTINF:10.0,
segment2.ts
#EXTINF:10.0,
segment3.ts
Each block tells the player: “This next segment is 10 seconds long, and here’s where to find it.”
4. Close the playlist (for VOD)
If your playlist is for on-demand content, you’ll end it with:
#EXT-X-ENDLIST
This signals to the player that the playlist is complete. Live playlists skip this tag because new segments keep arriving.
A complete example
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:10.0,
segment1.ts
#EXTINF:10.0,
segment2.ts
#EXTINF:10.0,
segment3.ts
#EXT-X-ENDLIST
This tiny file defines a three-segment video, each 10 seconds long, and marks the playlist as complete. It’s simple, readable, and forms the basis of all HLS workflows.
Creating an M3U8 playlist involves adding metadata tags (#EXTM3U, #EXT-X-VERSION, #EXT-X-TARGETDURATION) and listing each segment using #EXTINF followed by the segment path. VOD playlists end with #EXT-X-ENDLIST, while live playlists continuously update without closing the file.
If you prefer not to create playlists manually, most encoding pipelines, and platforms like FastPix, generate these files automatically during upload or transcoding.
If you prefer not to handle M3U8 creation manually, or deal with segmenting, encoding, packaging, or playlist updates, FastPix takes care of that entire workflow for you. When you upload a video (or ingest a live stream), FastPix automatically generates the HLS playlists, segments, variants, and playback URLs behind the scenes.
This means you get ready-to-stream M3U8 URLs without worrying about how the playlist is structured, how segments are named, or how adaptive bitrate levels are packaged. Everything is built into the pipeline.
Here’s how simple it is to start streaming through FastPix.
You can submit a remote video file to FastPix’s On-Demand API, and the platform handles the rest, encoding, segmentation, M3U8 playlist creation, DASH packaging, and playback generation.
Example request
POST https://v1.fastpix.io/on-demand
{
"inputs": [
{
"type": "video",
"url": "https://static.fastpix.io/sample.mp4"
}
],
"metadata": {
"key1": "value1"
},
"accessPolicy": "public",
"maxResolution": "1080p"
}
FastPix takes this input file, processes it into multiple renditions, and outputs both HLS (M3U8) and DASH playback URLs.
Example response
{
"success": true,
"data": {
"id": "15ad643b-1edb-411a-8074-2f806a407db4",
"trial": false,
"status": "created",
"createdAt": "2024-11-04T11:54:30.684444Z",
"updatedAt": "2024-11-04T11:54:30.684448Z",
"playbackIds": [
{
"id": "ebb682d6-bd65-44c3-b973-4c570bcd69b6",
"accessPolicy": "public"
}
],
"metadata": {
"key1": "value1"
},
"maxResolution": "1080p"
}
}
From this response, you can retrieve the playback ID and request the corresponding HLS playback URL.
Once you have the URL, you can plug it directly into
To learn how to create your own streams in FastPix, feel free to explore our docs and guides.
M3U8 drives live, VOD, and adaptive streaming. FastPix handles all the playlist generation automatically, so you don’t have to think about segments, packaging, or updates. Sign up and try for free with $25 free credit.
An M3U8 file is a UTF-8 encoded version of the M3U playlist format used for streaming media. It contains pointers to media segments or other playlists, enabling adaptive streaming, typically used in HTTP Live Streaming (HLS).
M3U and M3U8 are similar in structure, but M3U8 files are encoded in UTF-8, allowing them to support a wider range of characters, including non-ASCII characters. M3U files, on the other hand, are typically ASCII encoded. M3U8 is also more commonly used for HTTP Live Streaming (HLS), while M3U is often used for simple playlists in media players.
Buffering in M3U8 playback can be caused by several factors, such as insufficient bandwidth, server load, or network interruptions. To reduce buffering, ensure that the media segments in the M3U8 file are the appropriate length (usually between 6-10 seconds) and consider creating multiple bitrates for adaptive streaming to let users switch based on their network conditions.
You can secure M3U8 files by adding AES-128 encryption to the playlist, which requires an encryption key for decryption. Use #EXT-X-KEY in the playlist to specify the key’s URL. Additionally, token authentication or signed URLs can be used to restrict access to authorized users, often requiring integration with a backend authentication system.
FastPix offers a streamlined solution for creating and managing M3U8files, eliminating the need for manual file creation. With FastPix, users caneasily upload video content and automatically generate M3U8 playlists that[F1] support adaptive bitratestreaming. Additionally, FastPix integrates robust DRM solutions to protectyour content from unauthorized access.
Common issues with M3U8 files include playback errors, missing segments, and compatibility problems with media players. To fix these, ensure the M3U8 file and its segments are accessible and correctly linked, check for network stability, use a compatible player that supports HLS, and verify that CORS settings are properly configured on the server.
