.m3u8 MIME type
HLS playlistvideo
application/vnd.apple.mpegurlHTTP Live Streaming playlists that point at video segments.
| MIME type | application/vnd.apple.mpegurl |
|---|---|
| Extensions | .m3u8 |
| Also seen as | audio/mpegurl, application/x-mpegURL |
| Content-Type | application/vnd.apple.mpegurl |
| Compress in transit? | Yes — enable gzip or Brotli |
Good to know
- Safari and most mobile browsers play HLS natively; elsewhere, libraries such as hls.js play it through Media Source Extensions, which needs CORS on the playlist and segments.
- Playlists change during live streams, so give them short cache lifetimes; segments can be cached for long.
Serve .m3u8 files with the right type
The response header to send:
Content-Type: application/vnd.apple.mpegurl
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
application/vnd.apple.mpegurl m3u8;
Apache (.htaccess or server config)
AddType application/vnd.apple.mpegurl .m3u8
Express
res.set("Content-Type", "application/vnd.apple.mpegurl");Python
import mimetypes
mimetypes.add_type("application/vnd.apple.mpegurl", ".m3u8")HTML file input
<input type="file" accept=".m3u8,application/vnd.apple.mpegurl">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.m3u8 | grep -i '^content-type:' file --mime-type file.m3u8
Frequently asked questions
What is the MIME type for .m3u8 files?
application/vnd.apple.mpegurl. You may also see audio/mpegurl, application/x-mpegURL, but application/vnd.apple.mpegurl is the one to send.
What Content-Type header should a .m3u8 file be served with?
Content-Type: application/vnd.apple.mpegurl. It compresses well, so let the server apply gzip or Brotli.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options