The M3U format explained: how an IPTV playlist is built

Published:

M3U is a simple text format originally designed for music lists. Today it is the de facto standard for IPTV, and almost every player can open it. A file with the .m3u8 extension is the same format saved in UTF-8, so non-Latin channel names display correctly.

A minimal example

#EXTM3U url-tvg="https://example.com/epg.xml.gz"
#EXTINF:-1 tvg-id="news1" tvg-logo="https://example.com/news.png" group-title="News",News 24
https://example.com/stream/news.m3u8
  • #EXTM3U is the required first line. It often carries the TV guide address in url-tvg or x-tvg-url.
  • #EXTINF describes a channel. The number after the colon is the duration; live streams use -1. The text after the comma is the name viewers see.
  • The next line is the stream link.

Key attributes

Attribute Purpose
tvg-id channel identifier in the TV guide (EPG)
tvg-name name used for EPG matching
tvg-logo link to the channel logo
group-title category such as “Sports”, “Movies”, “Kids”
catchup, catchup-days catch-up archive settings

Some players also understand #EXTGRP: — a category on its own line — and #EXTVLCOPT:, which passes options such as a User-Agent to VLC.

Common mistakes

  • Missing #EXTM3U line — some players refuse to open the file.
  • Encoding other than UTF-8 — names turn into garbled characters.
  • Quotes inside a category name break attribute parsing.
  • Duplicate channels after merging several lists.

The easiest way to check and fix a playlist is the M3U editor: it parses the file, shows the categories and removes duplicates in one click. If you prefer working in a spreadsheet, use the M3U to CSV converter.

Docs and guides