Understanding IPTV4 min read

Inside M3U and Xtream Codes: how an IPTV playlist is written

We open a sample playlist line by line to show what each part does, why the guide sometimes doesn't match the channel and when to use M3U or Xtream.

By the Nineplay TeamPublished
Article cover: Inside M3U and Xtream Codes: how an IPTV playlist is written

In 30 seconds

  • An M3U playlist is a text file: each channel takes two lines, one with its info and one with the video address.
  • Attributes like tvg-id, tvg-logo and group-title tell the player each channel's guide, logo and category.
  • With Xtream Codes, the player talks to a server using a server address, username and password, and gets channels, movies and series already sorted.
  • Both formats work in Nineplay. Xtream usually brings more information; M3U is the most universal.

So what is an IPTV playlist, anyway

An IPTV playlist isn't the video itself. It's an index: text that tells the player where the channels, movies and series are and how to show them. It comes in two ways: an M3U link (an address that downloads that text) or an Xtream Codes login (server, username and password). The player reads that index and builds the catalog.

An M3U playlist, line by line

Below is a sample M3U playlist with made-up addresses. The numbers mark the parts explained right after.

Figure 1. A sample M3U playlist. All names and addresses are made up.
  • 1#EXTM3U opens the file and says it's an M3U playlist. The x-tvg-url, when present, points to the TV guide (EPG).
  • 2tvg-id is the channel's “ID card” in the guide. It's what links the channel to the right schedule.
  • 3tvg-logo is the address of the logo or artwork image.
  • 4group-title is the category. The player uses it to separate News, Sports, Movies and so on.
  • 5The text after the comma is the name shown on screen.
  • 6The line below is the video address: an .m3u8 (HLS, in chunks), a .ts (continuous stream) or a file like .mp4.
  • 7Movies and series come in the same format. The year and category in the name help the player find artwork and a synopsis.

How Xtream Codes works

With Xtream Codes there's no single file. The player connects to a server and asks questions: “what are the categories?”, “which channels are in Sports?”, “which episodes does this series have?”. The answers come back already organized.

What happens when you sign in with Xtream Codes

PlayerSends server, username and password
Xtream serverChecks the login and replies
CategoriesLive, movies and series separated
Catalog readyArtwork, seasons and guide when the server provides them
Figure 2. The player asks the server questions instead of downloading a single file.

In practice, that means catalogs that open faster on big playlists, series already grouped by season and, often, a TV guide and movie info provided by the server itself.

M3U or Xtream: which to use?

M3U vs. Xtream Codes

More dots means better on that criterion

M3UXtream Codes
How it arrivesA linkServer, username and password
Works in almost every player
Series grouped by seasondepends on the playlist
Opens fast on big playlists
Program guideif it has x-tvg-urlusually comes from the server
Figure 3. General comparison of the formats. Each provider sets up its playlist its own way.

If your provider offers both, Xtream usually gives the fuller experience. If you only have the link, M3U works just as well for watching; Nineplay fills in artwork and synopses the playlist doesn't include.

The most common playlist mistakes

Empty guide

tvg-id that doesn't match

If the channel's tvg-id doesn't exist in the guide file, the schedule stays empty. See the article on the TV guide.

Everything mixed up

No group-title

Without a category, every channel lands in a single group. The player has no way to guess how to organize them.

Won't open

Link copied halfway

M3U links tend to be long. One missing character at the end (sometimes the &output=ts itself) is enough to keep the playlist from loading.

Invalid login

A space in the username or password

With Xtream, an extra space when pasting the username or password causes a login error. In Nineplay, the sending screen cleans that up for you.

How the playlist gets into Nineplay

On phones and computers, you paste the M3U link or fill in the server, username and password right in the app, and the playlist is stored only on that device. On TVs, the playlist is sent from your phone, with a QR code and end-to-end encryption, without typing anything on the remote.

Nineplay's Connect your playlist screen, with the M3U link and Xtream options
Figure 4. The connect-your-playlist screen in the phone app: choose between M3U link and Xtream.

Quick quiz

3 questions to check what stuck. Tap an answer.

What does an M3U playlist contain?

Xtream Codes uses…

Why is the playlist link sensitive?

Frequently asked questions

What is tvg-id in an M3U playlist?

It's the channel's identifier in the TV guide. If it matches the one in the guide file (XMLTV), the player shows that channel's correct schedule.

What's the difference between M3U and M3U8?

Both are text playlists. M3U8 is the same thing saved in UTF-8, and it's also the name of the video index used by HLS. In practice, players open both.

Is Xtream Codes better than M3U?

For watching, both work. Xtream usually opens faster on big playlists and brings series and the guide already organized.

Try Nineplay for 7 days.

Create your account now and use it on iPhone, iPad, Mac, Apple TV, Android, Windows and Xbox. The other platforms join the same subscription.

Nineplay is a player app. We don't sell, provide or recommend channels, movies, series or playlists, and we don't support using content without authorization. Only use playlists from providers who have the right to stream them.