For music playlists:
#EXTM3U
#EXTINF:240,Beatles - Let It Be
/Music/Beatles/Let It Be.mp3
#EXTINF:213,Pink Floyd - Time
/Music/Pink Floyd/Time.flac
#EXTINF:355,Led Zeppelin - Stairway to Heaven
/Music/Led Zeppelin/Stairway to Heaven.mp3
The structure:
#EXTM3U: file header (required)
#EXTINF:duration,title: metadata for next track
- File paths: absolute or relative paths to media files
This is a simple, text-based playlist. Compatible with VLC, foobar2000, MusicBee, iTunes (sort of), etc.
For HLS streaming, M3U8 plays a different role:
Master playlist (lists multiple variants):
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=2000000,RESOLUTION=1280x720
720p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1000000,RESOLUTION=854x480
480p.m3u8
Variant playlist (lists segments):
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.000,
segment_001.ts
#EXTINF:10.000,
segment_002.ts
The HLS M3U8 references multiple bitrate variants. The player picks the right one based on bandwidth.
For HLS context, see DASH vs HLS Streaming.
| Use case | Format |
|---|
| Personal music library | M3U or M3U8 |
| Internet radio stream | M3U (with stream URL) |
| Spotify playlist export | M3U |
| HLS video streaming | M3U8 |
| Apple TV / iOS streaming | M3U8 |
| Live broadcast | M3U8 (HLS) |
For music: M3U/M3U8 are simple text references. For video streaming: M3U8 is part of HLS protocol.
For creating music playlists:
VLC:
- Open VLC
- Add files to playlist
- Media > Save Playlist to File
- Format: M3U or M3U8
MusicBee, foobar2000: similar workflow.
Spotify export: not directly supported. Use third-party tools like Soundiiz to export Spotify playlists to M3U.
Manual: text editor, write the M3U format yourself.
For batch playlist creation, see Batch Processing Files Guide.
For generating HLS streaming with FFmpeg:
# Generate HLS variants from MP4
ffmpeg -i source.mp4 \
-c:v libx264 -crf 22 \
-c:a aac -b:a 192k \
-f hls \
-hls_time 10 \
-hls_list_size 0 \
-hls_segment_filename "segment_%03d.ts" \
output.m3u8
For multi-bitrate HLS:
# Generate 720p, 480p, 240p variants
ffmpeg -i source.mp4 \
-map 0:v -map 0:v -map 0:v -map 0:a \
-c:v libx264 \
-filter:v:0 "scale=1280:720" -b:v:0 2000k \
-filter:v:1 "scale=854:480" -b:v:1 1000k \
-filter:v:2 "scale=426:240" -b:v:2 400k \
-c:a aac -b:a 192k \
-f hls \
-hls_time 6 \
-hls_list_size 0 \
-hls_segment_filename "segment_%v_%03d.ts" \
-master_pl_name master.m3u8 \
-var_stream_map "v:0,a:0 v:1,a:0 v:2,a:0" \
variant_%v.m3u8
The master_pl_name and var_stream_map create a master playlist referencing each variant.
For HLS streaming via CDN:
- Cloudflare Stream auto-generates HLS from upload
- Mux generates HLS automatically
- Bunny Stream generates HLS
- Self-hosted: serve M3U8 + segments via static file server
For CDN comparison, see Cloudflare Stream vs Mux vs Bunny.
| Player | M3U | M3U8 |
|---|
| VLC | Yes | Yes |
| foobar2000 | Yes | Yes |
| MusicBee | Yes | Yes |
| Apple Music app | Limited | Limited |
| iTunes legacy | Yes | Yes |
| Plex | Yes | Yes |
| Roon | Yes | Yes |
| Spotify | No (third-party tools needed) | No |
For most music libraries: M3U8 is the modern default. M3U for legacy compatibility.
| Player | HLS |
|---|
| Safari (iOS, macOS) | Native |
| Chrome | Via HLS.js or Shaka Player |
| Firefox | Via HLS.js or Shaka Player |
| Apple TV | Native |
| Smart TVs | Most via app SDKs |
| Mobile apps | Via AVPlayer (iOS), ExoPlayer (Android) |
For broadest reach: HLS works everywhere via player libraries.
M3U paths can be:
For portable playlists: use relative paths from the playlist file's location. The playlist remains valid when moved with its referenced files.
For shared playlists with files on different machines: absolute paths or URLs. Each player has different rules for path resolution.
Special characters fail in M3U: not UTF-8 encoded. Use M3U8 with explicit UTF-8 encoding.
Player can't find files: relative paths from wrong base. Verify paths are correct relative to playlist location.
HLS playback stutters: bitrate too high or segments too small. Adjust -hls_time flag.
Mobile player rejects HLS: missing required tags. Verify #EXT-X-VERSION and #EXT-X-TARGETDURATION exist.
Music playlist works in VLC but not other players: encoding mismatch. Save as UTF-8 BOM-free.
For new playlists: M3U8 (UTF-8 supports all characters). For legacy compatibility: M3U.
Yes. Download via yt-dlp, then run FFmpeg HLS generation on the local file.
XSPF (XML Sharable Playlist Format) is XML-based playlist alternative. Less popular than M3U/M3U8.
Yes. Path can reference any media type. Video players use M3U for video playlists.
Use Soundiiz, TuneMyMusic, or similar third-party tools. They export Spotify metadata to M3U format with file paths or stream URLs.
YouTube generates M3U8 (HLS) URLs internally for video streaming. They're not directly accessible but tools like yt-dlp can extract them.
For M3U/M3U8 in 2026: M3U8 for music playlists with international characters, HLS M3U8 for video streaming. They share format syntax but serve different purposes. FFmpeg generates HLS streams from any video source. Our video compressor handles source preparation before HLS encoding.