EPG and XMLTV Guide: How TV Listings Work in IPTV Players
Understand EPGs and the XMLTV format: channel ids, programme times, matching tvg-id, loading an EPG URL, refresh rates, .xml.gz files and troubleshooting.
By the IPTV Commons teamUpdated 5 min read
On this page
- What is XMLTV?
- What does an XMLTV file look like?
- How does a playlist channel match the guide?
- How do I load an EPG in a player?
- How often should the EPG refresh?
- What is an .xml.gz file?
- Where can guide data come from?
- How do I troubleshoot a blank or incomplete EPG?
- How big can an XMLTV file get?
- What other elements can XMLTV contain?
- Can I build my own guide file?
- Frequently asked questions
An EPG (electronic programme guide) is the on-screen TV listing that shows what is on now and next. In most IPTV player apps the guide comes from a separate file in the XMLTV format, which the player matches to your channels. If the match works, you see programme names and times; if not, you get blank rows.
This guide explains the XMLTV format, how matching works, how to load a guide in a player and how to troubleshoot it.
Quick answer: XMLTV is an XML file containing
<channel id="...">entries and<programme start stop channel>entries. A player shows guide data for a playlist channel when the channel'stvg-idequals a channel id in the XMLTV file.
What is XMLTV?
XMLTV is an XML-based format for describing TV listings, introduced in 2002 and maintained by the XMLTV project. A file has a <tv> root element holding <channel> records and <programme> records. The structure is defined by a DTD (a formal description of the allowed elements) that the project publishes.
What does an XMLTV file look like?
<?xml version="1.0" encoding="UTF-8"?>
<tv generator-info-name="example-generator">
<channel id="ExampleNewsHD.uk">
<display-name>Example News HD</display-name>
<icon src="https://example.com/logos/example-news.png"/>
</channel>
<programme start="20261024180000 +0100" stop="20261024183000 +0100" channel="ExampleNewsHD.uk">
<title lang="en">Example Evening Bulletin</title>
<desc lang="en">A fictional news programme used for this example.</desc>
</programme>
</tv>
Key points:
- Each
<channel>has anidthat programmes refer to, plus one or more<display-name>entries. - Each
<programme>hasstart,stopandchannelattributes. - Times are written
YYYYMMDDhhmmssfollowed by a space and a UTC offset. In the example,+0100means one hour ahead of UTC, which is British Summer Time. In winter UK times use+0000. <title>and<desc>carry the programme text, with alangattribute for language.
If a file omits the offset, readers may assume UTC, which is a common source of wrong times; see EPG showing the wrong time.
How does a playlist channel match the guide?
Matching is done on the id. In your M3U playlist the channel carries tvg-id="ExampleNewsHD.uk"; the XMLTV file has <channel id="ExampleNewsHD.uk">. They must be identical, including case, punctuation and any suffix. If they differ by even one character the player will find no data. Some players fall back to matching by name, but that is less reliable.
How do I load an EPG in a player?
The exact menus differ between apps, but the steps are usually the same:
- Open the player's settings and find the EPG, guide or XMLTV section.
- Paste the guide address, or let the playlist's
url-tvg/x-tvg-urlheader supply it. - Choose how often to update it.
- Trigger a refresh and wait; large files take time to process.
- Check that channels now show programme information.
If the player offers manual mapping, match unmatched channels to guide channels yourself. See the player guides, such as TiviMate setup.
How often should the EPG refresh?
Guide data usually covers several days ahead, so refreshing once or twice a day is normally enough. Refreshing every few minutes puts needless load on the host and can get your device blocked. Choose the schedule the app suggests, and if the app lets you pick a time, pick off-peak.
What is an .xml.gz file?
Guide files can be large, so they are often gzip-compressed and end in .xml.gz. Most players read compressed guides directly. If yours does not, decompress the file on a computer, or use an uncompressed address if the source provides one.
Where can guide data come from?
Guide data needs a source with permission to distribute it. Open-source grabber projects exist, such as iptv-org/epg, which is a command-line tool that downloads programme information from various websites and writes a guide.xml file. Its own readme says nothing about the terms of the websites it reads, so check each source's terms before using it. Broadcasters and some platforms also publish listings under their own conditions. Our forum can point you to community tools in the EPG and guides category.
How do I troubleshoot a blank or incomplete EPG?
| Problem | What to check |
|---|---|
| No guide at all | Guide address entered and refreshed? |
| Some channels blank | tvg-id and channel id differ |
| Guide loads, but wrong times | Offset or time zone issue |
| Guide stops after a few days | The file only covers a limited window; refresh it |
| App very slow after loading | The guide file is huge; use a smaller one for your channels only |
| Error on loading | File truncated, invalid XML or access blocked |
You can open an XMLTV file in a text editor and search for your channel id to confirm it exists. Check against the XMLTV project's published DTD if the player complains about validity.
How big can an XMLTV file get?
A guide covering hundreds of channels for many days can run to many megabytes uncompressed, and parsing it takes memory and time. On weaker devices this is a common reason for slow loading or a player that appears to freeze after you add a guide. Compression helps the download but not the parsing. If the player is slow, use a guide limited to the channels you actually watch, which some tools can produce from a channel list.
What other elements can XMLTV contain?
Beyond title and description, the format allows more detailed fields. Which of them a player shows depends on the app:
| Element | Meaning |
|---|---|
<sub-title> |
Episode name |
<category> |
Genre, such as news or sport |
<episode-num> |
Series and episode numbering |
<icon> |
Image for the channel or programme |
<length> |
Programme length |
Players generally ignore elements they do not use, so a rich file does no harm. See the XMLTV project's published DTD for the exact structure.
Can I build my own guide file?
For a handful of channels you can write XMLTV by hand, as in the example above, and host it on a local server. Add each channel and then its programmes, keep times in the correct offset, and make sure the XML is well formed, with every element closed. For anything larger, a generator or grabber saves a lot of effort. Always check that you have the right to use and distribute the data you include.
Frequently asked questions
What is the difference between an EPG and XMLTV?
EPG is the feature; XMLTV is one common file format used to supply the data to it.
Why does my EPG show nothing for a channel?
Usually the channel's tvg-id doesn't match any channel id in the guide file, or the guide hasn't been loaded or refreshed.
Can one EPG file serve several playlists?
Yes, if the ids match your channels. Guide files often contain many more channels than you use.
Do I need to unzip .xml.gz files?
Usually not; most players read them directly. If yours doesn't, decompress them first.
How far ahead does an EPG go?
It depends on the file. Many cover a few days to a week or more. Refresh regularly to keep it topped up.
Related guides
M3U Playlists Explained: Format, Tags and Common Errors
A clear guide to the M3U and M3U8 playlist format: #EXTM3U, #EXTINF, tvg-id, group-title, EPG links, catch-up tags, safe editing and common errors.
6 min read
IPTV basicsIPTV Glossary: 60+ Terms Explained in Plain English
An A–Z IPTV glossary in plain British English: EPG, XMLTV, M3U, tvg-id, HLS, HEVC, multicast, catch-up, Widevine and more, with links to our deeper guides.
7 min read
Players & appsKodi for Beginners: Safe Install, Settings and IPTV Simple Client
A beginner's guide to Kodi: install it from official sources, set it up, add live TV with PVR IPTV Simple Client, and avoid dodgy builds and add-ons.
6 min read
DevicesAndroid TV Box Buying Guide: What to Look For in 2026
How to choose an Android TV or Google TV box: certification, Widevine L1, chipset, memory, codecs, Ethernet, updates, and how to spot an uncertified box.
6 min read