Xtream Codes M3U: What It Is and How to Use It
M3U playlists are how many apps consume an Xtream Codes portal without a native login. Learn the format, how portals generate the playlist URL, and when M3U makes sense.
An M3U playlist is the simplest way to load an IPTV channel list into almost any player. Xtream Codes portals can generate one from your account, which makes it a useful fallback when an app lacks native Xtream Codes support.
M3U is a plain-text playlist format: each line is a stream URL, and extended attributes give the player a display name, channel logo, and program-guide ID for every entry. Because the format is decades old and nearly every media app can open it, it is the universal adapter for IPTV. This guide covers the format, how Xtream Codes portals generate a playlist URL from your credentials, when to use M3U instead of the native API login, and the security rules that follow from the URL containing your password.
What M3U is
M3U began as a playlist format for media players. A playlist is just a text file: each line points to a file or stream. For IPTV, the important variant is M3U8 with extended attributes (#EXTINF lines), which is what portals emit.
A typical IPTV playlist looks like this:
#EXTM3U
#EXTINF:-1 tvg-id="bbc.one.uk" tvg-logo="https://cdn.example.com/logos/bbc.png",BBC One
https://portal.example.com:8080/live/user1/pass1/12345.ts
#EXTINF:-1 tvg-id="itv1.uk" tvg-logo="https://cdn.example.com/logos/itv.png",ITV 1
https://portal.example.com:8080/live/user1/pass1/12346.ts
Each channel gets one #EXTINF line (name, logo, guide ID) followed by its stream URL.
What the extended attributes mean
The #EXTINF line carries the metadata players use to render your channel list:
| Attribute | Example value | Purpose |
|---|---|---|
tvg-id | bbc.one.uk | The ID matched against the EPG feed for the schedule |
tvg-name | BBC One | A friendly name for sorting and display |
tvg-logo | https://cdn.example.com/logos/bbc.png | The channel logo URL |
group-title | `UK | Entertainment` |
The tvg-id is the one that matters most: if it does not match an ID in your EPG feed, the channel plays fine but shows no program guide. The m3u_plus output type includes these attributes; a plain m3u output may omit them.
How Xtream Codes generates a playlist
When an app does not support the Xtream Codes API, many providers expose a playlist URL built from your account. It looks like this:
https://portal.example.com:8080/get.php?username=YOUR_USER&password=YOUR_PASS&type=m3u_plus&output=ts
The get.php endpoint reads the credentials and returns the full channel list as M3U. Some players only need you to paste this URL once, and the app refreshes it on startup.
When to use M3U instead of an API login
Use M3U when:
- The app has no native Xtream Codes login, but accepts a playlist URL (VLC, Kodi, many desktop players).
- You want a single static list without the portal’s category structure.
- The provider does not offer player-API access on your plan.
Prefer the native API login when the app supports it: you get categories, the full guide, per-channel logos, and automatic account validation.
M3U playlist vs Xtream Codes API login
| Capability | M3U playlist | Native API login |
|---|---|---|
| Works in any M3U-aware app (VLC, Kodi) | Yes | Only in apps with Xtream Codes support |
| Fetches live channels | Yes | Yes |
| Automatic categories/groups | Via group-title | Yes, native |
| Automatic EPG pairing | Requires matching tvg-id | Usually automatic |
| Detects invalid credentials on load | No — plays nothing | Yes |
| Account validation on load | No | Yes |
| Refresh behavior | Snapshot until re-downloaded | Dynamic from the portal |
The practical rule: use the API login when the app supports it, and fall back to M3U when it does not. A playlist is a snapshot; the API is live. If you watch mostly through VLC or a desktop player with no Xtream Codes support, M3U is the correct choice despite the trade-offs.
M3U and EPG
M3U playlists usually include tvg-id values that must line up with a separate EPG (Electronic Program Guide) feed. The portal commonly exposes one at a URL like:
https://portal.example.com:8080/xmltv.php?username=YOUR_USER&password=YOUR_PASS
You enter that URL as the guide source in apps that separate the playlist from the guide. If the IDs in the playlist match the IDs in the guide, your channels show correct program information. This is covered in detail in Xtream Codes EPG.
Security notes
The playlist URL and the M3U file contain your username and password. Treat them as secrets:
- Do not paste full URLs into public forums or chat.
- Store local copies where only you can read them.
- If the URL leaks, rotate your password at the provider.
More guidance is in Xtream Codes security.
Good practice
- Refresh regularly — portal playlists can change when your provider adds or removes channels.
- Match the format —
m3u_plusincludes logos and guide IDs; plainm3umay not. - Test in VLC first — a quick VLC open confirms the URL is valid before you set up a full player.
- Only stream authorized content — the playlist only contains what your account is entitled to watch.
Related reading
- Xtream Codes EPG — pairing program guide data with your playlist.
- How to log in to Xtream Codes — the native login flow that replaces M3U in most apps.
- The Xtream Codes API — what
get.phpand the other endpoints do.
Frequently asked questions
What is an M3U file?
M3U is a plain-text playlist format. Each entry is a line containing a stream URL, usually preceded by metadata lines such as a display name, channel logo, and program guide ID.
Does Xtream Codes use M3U by default?
No. The Xtream Codes player API serves structured channel data to native integrations. M3U is an older, simpler format the same portal can also export for compatibility with apps that do not speak the API.
Is an M3U playlist the same as an Xtream Codes login?
Not exactly. A login lets a player fetch channels, categories, and EPG dynamically. An M3U playlist is a snapshot of stream URLs, often with a separate EPG link, that an app plays directly.
References
Written by
Alex CarterTechnical Writer & IPTV Technology Analyst
Alex Carter is a technical writer and streaming-technology analyst with over a decade of experience documenting IPTV infrastructure, media player software, and streaming protocols. Alex has worked hands-on with Xtream Codes, M3U, and EPG tooling across Fire TV, Android, and smart-TV platforms, and writes approachable guides that respect both the reader's time and the legal boundaries of streaming technology.
- 10+ years documenting streaming and IPTV technologies
- Practical experience with Xtream Codes, M3U, EPG, and player software
- Focused on accurate, sourced, and privacy-respecting guidance
Related guides
fundamentals
Xtream Codes EPG: Setting Up an Electronic Program Guide
The EPG feed supplies the program grid for IPTV channels. Xtream Codes portals expose an XMLTV feed that players merge with your channel list to show what's on now and next.
fundamentals
What is Xtream Codes?
Xtream Codes is a portal, player API, and content-management system that IPTV providers use to serve live channels, movies, and series to authorized subscribers.
setup
How to Log In to Xtream Codes
Log in to Xtream Codes by entering three things in your player: the host (server URL), username, and password. Here is exactly how to do it and what to do when it fails.